File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -179,8 +179,7 @@ def query_runner(query):
179179 if "sort" in query_data and query_data ["sort" ]:
180180 s = []
181181 for field in query_data ["sort" ]:
182- for k in field :
183- s .append ((k , field [k ]))
182+ s .append ((field ["name" ], field ["direction" ]))
184183
185184 if "fields" in query_data :
186185 f = query_data ["fields" ]
@@ -192,11 +191,18 @@ def query_runner(query):
192191 json_data = None
193192
194193 cursor = None
195- if q :
194+ if q or ( not q and not aggregate ) :
196195 if s :
197196 cursor = db [collection ].find (q , f ).sort (s )
198197 else :
199198 cursor = db [collection ].find (q , f )
199+
200+ if "skip" in query_data :
201+ cursor = cursor .skip (query_data ["skip" ])
202+
203+ if "limit" in query_data :
204+ cursor = cursor .limit (query_data ["limit" ])
205+
200206 elif aggregate :
201207 r = db [collection ].aggregate (aggregate )
202208 cursor = r ["result" ]
You can’t perform that action at this time.
0 commit comments