Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Running findAndModify fails with certain queries #18

Open
patrickod opened this issue Sep 30, 2011 · 0 comments
Open

Running findAndModify fails with certain queries #18

patrickod opened this issue Sep 30, 2011 · 0 comments

Comments

@patrickod
Copy link

When running findAndyModify commands with a SON object in the following context the query argument is put at the start of the SON object thus causing an error with Mongo

from bson.son import SON
from bson import ObjectId
q = SON()
q['findAndModify'] = 'collection'
q['query'] = {"_id" : ObjectId("valid-object-id")}

database.command(q, callback=callback)

The SON object is re-ordered putting the query item in front of findAndModify and thus the query fails.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant