Search code examples
gremlingraph-databasestinkerpop3

How do I see if a value exists in any property for gremlin?


I have a gremlin 3.4.9 set up, with a few different types of vertexes. (people, jobs, homes for example). I want to be able to traverse all of these samples and see if any of the properties contain a value. for example:

I have a:

people vertex with the properties: name, age, location, bio

job vertex with the properties: title, pay, location, description

home vertex with the properties: cost, location, description

and I want to see if any of these properties of these vertices contain the value "family". What would that query look like?


Solution

  • You can search the properties values like this:

    g.V().properties().hasValue("family");

    This seems to work across different Vertices (which I believe is what you are looking for)