You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by GitBox <gi...@apache.org> on 2019/11/29 19:14:55 UTC

[GitHub] [tinkerpop] dkuppitz commented on issue #1224: TINKERPOP-1733 Support g.E().properties().hasKey('xx') & hasValue('xx')

dkuppitz commented on issue #1224: TINKERPOP-1733 Support g.E().properties().hasKey('xx') & hasValue('xx')
URL: https://github.com/apache/tinkerpop/pull/1224#issuecomment-559866968
 
 
   @spmallette From the old PR:
   
   > I assume you like where this PR is going. if we make hasKey() behave uniformly for Element and Property where does that leave {{has(String)}}:
   > 
   > ```
   > gremlin> g.V(1).properties().has('name')
   > gremlin> g.V(1).properties().hasKey('name')
   > ==>vp[name->marko]
   > ```
   
   What you show is the expected result, checking for a property existence is different from checking if the key of a keyed element matches a given value. Thus I don't think we can remove/deprecate `has(String)`.
   
   ```
   gremlin> g.V().has("location")
   ==>v[1]
   ==>v[7]
   ==>v[8]
   ==>v[9]
   gremlin> g.V().properties().hasKey("location").limit(4)
   ==>vp[location->san diego]
   ==>vp[location->santa cruz]
   ==>vp[location->brussels]
   ==>vp[location->santa fe]
   gremlin> g.V().properties().hasKey("location").not(has("endTime"))
   ==>vp[location->santa fe]
   ==>vp[location->purcellville]
   ==>vp[location->seattle]
   ==>vp[location->aachen]
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services