Skip to content
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

How to query document using key #55

Open
meetjaydeep opened this issue Mar 20, 2019 · 0 comments
Open

How to query document using key #55

meetjaydeep opened this issue Mar 20, 2019 · 0 comments

Comments

@meetjaydeep
Copy link

meetjaydeep commented Mar 20, 2019

In below code I want to fetch only the values of User1 in descending order of Item values.
but I'm unable to fetch it using below query.

op = Output()
op.data =  {"User1": {"Item2": 2, "Item3": -1, "Item4": 3}, "User2": {"Item4": 2, "Item5": 1, "Item6": 2}}
r = op.query.filter({Output.data:{"User1":{'$exists':True}}})
result = r.all()

Expected result:
["Item4","Item2","Item3"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant