JasperVanDenBosch / niprov

provenance for neuroimaging data
BSD 3-Clause "New" or "Revised" License
9 stars 0 forks source link

PyMongo sort syntax bug; if no direction is specified, key_or_list must be an instance of list #33

Closed JasperVanDenBosch closed 9 years ago

JasperVanDenBosch commented 9 years ago
  File "/home/jasperb/Projects/niprov/niprov/views.py", line 12, in latest
    return {'images':repository.latest()}
  File "/home/jasperb/Projects/niprov/niprov/mongo.py", line 122, in latest
    records = self.db.provenance.find().sort({'added': -1}).limit(20)
  File "/home/jasperb/Projects/niprov/env/local/lib/python2.7/site-packages/pymongo/cursor.py", line 623, in sort
    keys = helpers._index_list(key_or_list, direction)
  File "/home/jasperb/Projects/niprov/env/local/lib/python2.7/site-packages/pymongo/helpers.py", line 55, in _index_list
    raise TypeError("if no direction is specified, "
TypeError: if no direction is specified, key_or_list must be an instance of list

pymongo==3.0.3

JasperVanDenBosch commented 9 years ago

Fixed for this version. May need to set specific pymongo version in requirements?