Re: [Neo4j] Gremlin query like SQL IN operator?

80 views
Skip to first unread message

Marko Rodriguez

unread,
Apr 29, 2013, 10:34:40 AM4/29/13
to ne...@googlegroups.com
Hi,

Assuming you have an index on 'email' property (else a linear can will be invoked) and you want the 'name' property of the vertex with that email:

(xxx,yyy,…).collect{
g.V('email',it).name.next()
}

I don't know what version of Gremlin you are using but that is the way for the most prevalent version.

You can also look into Blueprints 2.3.0 and Graph.query().

HTH,
Marko.


On Apr 29, 2013, at 3:01 AM, Ivan Despic <desp...@gmail.com> wrote:

Im stuck with gremlin. I have emails like array and I need to make query to find all user with those emails.

In SQL I have

SELECT email(s)
FROM user
WHERE email IN (xxx, yyy...)

How can I do this in Gremlin query language?


--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Marko Rodriguez

unread,
Apr 29, 2013, 10:36:28 AM4/29/13
to ne...@googlegroups.com
Apologies:

[xxx,yyy].collect{ … }

Not, ( ). In other terms, array syntax.

gremlin> ['a','b','c'].collect{ it + it }
==>aa
==>bb
==>cc

Marko.
Reply all
Reply to author
Forward
0 new messages