Open cben opened 9 months ago
Thanks! Shouldn't the dependency be updated as well?
This updates the code to match documented functionality for pymongo==3.13.0
currently in requirements.txt.
The dependency has already been bumped in commit 8406b3189797a5b14059ce5dc8ffe2e12b4e9f28 and I'm pretty convinced these code paths have been broken since :-D
Oh yes here it is in the docs:
Changed in version 3.0: Changed the parameter names
spec
,fields
,timeout
, andpartial
tofilter
,projection
,no_cursor_timeout
, andallow_partial_results
respectively. ...
Also here in pymongo 2->3 migration guide: https://pymongo.readthedocs.io/en/3.12.1/migrate-to-pymongo3.html#fields-renamed-projection
With current pymongo==3.13.0, was causing exception:
Now works:
I tested the other calls too;
updatemanpage
unreachable from current CLI but tested same call in another code path.Not sure when pymongo API changed; oldest doc I found online https://pymongo.readthedocs.io/en/3.5.1/api/pymongo/collection.html#pymongo.collection.Collection.find which doesn't mention
fields=
onlyprojection=
. Probably broken since 8406b3189797a5b14059ce5dc8ffe2e12b4e9f28?Change from {x: 1} to ['x'] style is cosmetic, reads less magic to me, but
projection
arg supports both.