-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Q object filter() for connected nodes #535
Comments
Thank you for the amazing library! I'm having the same problem. Is this going to be supported in future? For a simple query as following either one needs to apply plain cypher or run offline for loops to search. Query-> Find me a patient who is registered in hospitals of given names. Just like @zacharymostowsky I would write the query as patient.registered_with.filter(Q(hospital_name__icontains='X') | Q(hospital_name__icontains='Y')) |
I haven’t seen any update. I’m not that confident to put in a PR by myself to fix this but happy to pair on it. In the meantime I wrote a custom cypher query and inflated my model objects to produce the desired result. Hope this helps. Let me know if you want to tak anything through. |
@zacharymostowsky Can you share your workaround please. I'm new to neo and struggling. |
Sure np, this is a query I wrote to essentially search a users followers by first and last name. Optionally you can add it this as a method to your NeoModel StructuredNode and reference the class with
|
@zacharymostowsky @yantraupesh Thanks for this note but I am just wondering if this has something to do with the way you are trying to use this functionality. See here for example. Let me know if this works, sorry for the late reply. |
Hi,
I am trying to use a Q object search to lookup a user's following by firstName and lastName. Is this not supported?
I receive error that
filter()
function can take only 1 positional argument.userFollowing = neoUser.following.filter(Q(firstName__icontains=filterText) | Q(lastName__icontains=filterText))
Note, I can use the Q object filter directly on the NeoUser queryset like below.
userFollowing = NeoUser.nodes.filter(Q(firstName__icontains=filterText) | Q(lastName__icontains=filterText))
Thanks in advance. Love the library.
The text was updated successfully, but these errors were encountered: