Neo4J Java findNodes with other than a single string match -


i'm using neo4j java api (currently version 2.2.1) simple queries this:

label label = dynamiclabel.label("user"); resourceiterator<node> providers = graphdb.findnodes(         label, "username", "player1")); 

but there way allow other simple match (string in case) values? can regex, or provide list of possible values key match on string comparisons? if so, there examples out there?

i've dug around docs , favorite search engines , can't seem find other straight string match (such this: http://neo4j.com/docs/2.2.1/tutorials-java-embedded-new-index.html).

you'll rapidly find might want execute cypher queries inside of java kind of querying.

string query = "match (n:label) n.username =~ ".*foo regex.*" return n;"; try ( transaction ignored = db.begintx();       result result = db.execute(query) ) {     while ( result.hasnext() )     {          // nifty stuff results.     } } 

the regular embedded api methods you're using aren't going support regex or great deal of other things, i'd suggest using cypher except simple cases (like "get node property , value")


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -