Skip to content

Commit 1b7cb5a

Browse files
author
GustavoRPS
committed
bugfix mongodb
1 parent 6c1536b commit 1b7cb5a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

hash_data_api/datasources/mongo.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,16 @@ def query(self, **kargs):
5151
append2sort((property, direction))
5252

5353
if kargs.get('fields'):
54-
fields = { '_id': True }
55-
for f in kargs['fields']:
56-
fields[f] = True
57-
kargs['fields'] = fields
54+
kargs['fields'].append('_id')
5855
else:
5956
kargs['fields'] = None
6057

6158
return collection.find(
6259
filter=filter,
6360
projection=kargs['fields'],
64-
sort=sort,
6561
skip=kargs['skip'],
66-
limit=kargs['limit'],)
62+
limit=kargs['limit'],
63+
sort=sort,)
6764

6865
def fetch(self, id):
6966
pass

0 commit comments

Comments
 (0)