Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-03-2020 09:24 AM
Hi all,
in a use-case we'd like to provide a parameter as an array which is used with the IN operator:
MATCH
(p:Person)
WHERE
p.name in ["foo","bar"]
RETURN
p
Can we rely on the Person nodes being returned in the order as given by the values in the array, i.e. first all persons with the name "foo", then those with the name "bar"?
Cheers
Dirk
12-03-2020 10:51 AM
Try this:
MATCH
(p:Person)
WHERE
p.name in ["foo","bar"]
WITH p order by p.name ASC
RETURN
p
12-04-2020 12:59 AM
My question goes into a different direction:
The array parameter already provides an arbitrary order which cannot be expressed by an order by (e.g. defined by a user). The intention of the query is to fetch more data (e.g. attributes/relations) of the Person keeping the provided order.
Cheers
Dirk
All the sessions of the conference are now available online