File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,11 @@ def main():
8080
8181 query = json .dumps ({"otherkey" : "bar" })
8282 print ("Should return third item with auto-generated _key: %s" % json .dumps (collection .data .query (query = query ), indent = 1 ))
83-
83+
84+ # passing query data as dict
85+ query = {"somekey" : {"$gt" : 1 }}
86+ print ("Should return item2 and item3: %s" % json .dumps (collection .data .query (query = query ), indent = 1 ))
87+
8488 # Let's delete the collection
8589 collection .delete ()
8690
Original file line number Diff line number Diff line change @@ -3640,6 +3640,11 @@ def query(self, **query):
36403640 :return: Array of documents retrieved by query.
36413641 :rtype: ``array``
36423642 """
3643+
3644+ for key , value in query .items ():
3645+ if isinstance (query [key ], dict ):
3646+ query [key ] = json .dumps (value )
3647+
36433648 return json .loads (self ._get ('' , ** query ).body .read ().decode ('utf-8' ))
36443649
36453650 def query_by_id (self , id ):
You can’t perform that action at this time.
0 commit comments