Recently I start to useing neo4j and neomodel and now I need to filter 2 parameters with OR in neomodel. I searched in document and codes but couldn't find anything about it. In django model there is a Q object to handle OR in queries. How can handle OR query in neomodel? I have to get query params from http request and response to it. Neomodel handle AND but I have no idea for handling queries with OR. Is there any way to handle it with out using cypher mannualy?
Asked
Active
Viewed 329 times
0
-
I made some changes to solve this issue. Visit https://github.com/neo4j-contrib/neomodel/pull/336 – mastisa May 15 '18 at 10:33
-
This feature added to neomodel: https://github.com/neo4j-contrib/neomodel/blob/master/doc/source/queries.rst#complex-lookups-with-q-objects – mastisa Sep 29 '18 at 04:58
2 Answers
1
In version neomodel 3.3.4(3) exists Q support.
Model.nodes.filter(Q(Q(a) | Q(b)) & Q(c))

scopchanov
- 7,966
- 10
- 40
- 68

Тимур Марданов
- 11
- 1
0
There is a double-underscore prefixed in
operator as described in the advanced queries section of the docs. So it's like title__in

Laszlo T
- 1,165
- 10
- 22
-
There is not a such thing for OR. I need something like this **created>=30 OR updated>=30**. How can I do this? I look at codes and in build_where_stmt function AND is fixed, I think for now there is no support for OR in neomodel query. – mastisa May 15 '18 at 05:08