spmallette commented on code in PR #3458: URL: https://github.com/apache/tinkerpop/pull/3458#discussion_r3443748294
########## docs/src/dev/provider/gremlin-semantics.asciidoc: ########## @@ -1637,6 +1668,170 @@ See: link:https://github.com/apache/tinkerpop/tree/x.y.z/gremlin-core/src/main/j link:https://github.com/apache/tinkerpop/tree/x.y.z/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroupCountSideEffectStep.java[source (sideEffect)], link:https://tinkerpop.apache.org/docs/x.y.z/reference/#groupcount-step[reference] +[[has-step]] +=== has() + +*Description:* Filters traversers by property existence, property value, or label. + +*Syntax:* `has(String key)` | `has(String key, Object value)` | `has(String key, P predicate)` | `has(String key, Traversal traversal)` | `has(String label, String key, Object value)` | `has(String label, String key, P predicate)` + +[width="100%",options="header"] +|========================================================= +|Start Step |Mid Step |Modulated |Domain |Range +|N |Y |N |`Element` / `Map` |`Element` / `Map` +|========================================================= + +*Arguments:* + +* `key` - The property key to check. +* `value` - The value to compare against using equality. May be a literal or a `Traversal`. +* `predicate` - A `P` predicate for comparison. The predicate value may be a literal or a `Traversal`. +* `traversal` - A child traversal whose first result is used as the comparison value (implicitly wrapped in `P.eq()`). + Must be read-only. +* `label` - A label filter applied before the property check. + +*Modulation:* + +None + +*Considerations:* + +* `has(key)` filters to elements that have the specified property (existence check). +* When a `Traversal` is supplied as a value or inside a `P`, it is resolved per-traverser and its first result is used. +* Child traversals must be read-only; mutating steps are rejected with `IllegalArgumentException`. +* For `within()`/`without()` predicates with traversal arguments, use `fold()` to collect multiple results into a list. + +See: link:https://github.com/apache/tinkerpop/tree/x.y.z/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasStep.java[source], +link:https://tinkerpop.apache.org/docs/x.y.z/reference/#has-step[reference] + +[[hasid-step]] +=== hasId() + +*Description:* Filters elements by their identifier. + +*Syntax:* `hasId(Object id, Object... otherIds)` | `hasId(P predicate)` | `hasId(Traversal traversal)` + +[width="100%",options="header"] +|========================================================= +|Start Step |Mid Step |Modulated |Domain |Range +|N |Y |N |`Element` |`Element` +|========================================================= + +*Arguments:* Review Comment: ``` gremlin> g.V().hasId([2,3]) ==>v[2] ==>v[3] ``` -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
