How can I find property with a certain data type?

I have a situation where the same property has different type under the same label, kind of like the following:

g.addV("Cookies").property(single, "howMany", "10").next()
g.addV("Cookies").property(single, "howMany", 42).next()

I am hoping to query for Cookies that only has "howMany" property that is in String, for example. We accidentally corrupted our DB with mixed types and need to find which ones are corrupted. What I am hoping to see is something like.

g.V().hasLabel("Cookies").proporties("howMany").ofType(String)
Solution
Which Graph Database are you using @ManabuBeach ? Currently Gremlin does not have any easy way to test the type of a property value built in to the language. It is something we have discussed adding in a future update. Unless the graph database backend you are using allows for lambdas/closures, you may have to do this mostly in the application.
Was this page helpful?