[
https://issues.apache.org/jira/browse/TINKERPOP-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18030705#comment-18030705
]
ASF GitHub Bot commented on TINKERPOP-2234:
-------------------------------------------
spmallette commented on code in PR #3211:
URL: https://github.com/apache/tinkerpop/pull/3211#discussion_r2440640916
##########
docs/src/upgrade/release-3.8.x.asciidoc:
##########
@@ -50,11 +50,46 @@ gremlin>
g.V().has('airport','code','IAD').valueMap('code','desc','lon','lat')
==>[code:[IAD],lon:[-77.45580292],lat:[38.94449997],desc:[Washington Dulles
International Airport]]
----
+==== Type Predicate
+
+The new `P.typeOf()` predicate allows filtering traversers based on their
runtime type. It accepts either a `GType`
+enum constant or a string representation of a simple class name. This
predicate is particularly useful for type-safe
+filtering in heterogeneous data scenarios.
Review Comment:
> This predicate is particularly useful for type-safe filtering in
heterogeneous data scenarios.
the examples should demonstrate that better since this is deemed
"particularly useful". how about:
```
g.V().values("age","name").is(P.typeOf("Integer"))
```
to drive this section.
> Introduce Type Predicate
> ------------------------
>
> Key: TINKERPOP-2234
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2234
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.4.2
> Reporter: Stephen Mallette
> Priority: Major
>
> Provide for a {{typeOf()}} predicate that allows for testing the type of an
> object which would enable neat things like:
> {code}
> g.V().outE().has('weight',gt(0.1)).inV().path().unfold().is(typeOf(VERTEX))
> {code}
> See the linked DISCUSS thread for more information.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)