Skip to content

How to query document using key #55

Open
@meetjaydeep

Description

@meetjaydeep

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"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions