How to search node using cypher query where one of the node property having array of string ?
e.g. members-- > ["abc","xyz","pqr"]
.
I can find the node by keeping order of array elements in same manner, for e.g.
START root=node(*) where has(root.members) and root.members=["abc","xyz","pqr"] return root;
but How to search node if I do not / cannot provide the exact order of elements as they are in node property ?
Use the "all" predicate to ensure every element in the root.member is in the given list, i.e. root.members is a subset of the given list, and the length expression ensures that the given list has no more elements than what is in the root.members, so both of them contain the exactly same members.
START root=node(*)
Where has(root.members) and all ( m in root.members where m in ["abc","xyz","pqr"]) and length(root.members) = length(["abc","xyz","pqr"])
Return root
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With