Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-04-2018 03:55 PM
whats the most efficient way in Cypher to check for a value in an array? For example, if i wanted to check an array property of numbers [5,6,7], I could use the $in operator. but is there a better/recommended way ?
09-04-2018 04:09 PM
That should work in most cases. If you have a much larger set of values, then it might be worth using APOC Procedures, as you can use apoc.coll.contains()
or apoc.coll.containsAll()
which use a set under the hood.
09-05-2018 05:10 AM
Cypher itself also got better under the hood. It creates a companion set under the hood while checking iteratively for the first time.
The only thing that doesn't work with schema indexes is to lookup values inside of the array from the index.
That's something that works with explicit indexes.
All the sessions of the conference are now available online