TinyMongo allows you to update a document like this:
collection.update_one({"_id": "fh98h43f89fh4fh"}, {"some_field": "some update"})
But on the real MongoDB database (on mLab) I get this error: ValueError: update only works with $ operators.
So I needed to change the code like this:
collection.update_one({"_id": "fh98h43f89fh4fh"}, {"$set": {"some_field": "some update"}})
This also works on TinyMongo and it is a more appropriate way to update a document. TinyMongo should follow the MongoDB/pymongo behaviour and throw the same error in the first case.
TinyMongo allows you to update a document like this:
But on the real MongoDB database (on mLab) I get this error:
ValueError: update only works with $ operators.So I needed to change the code like this:
This also works on TinyMongo and it is a more appropriate way to update a document. TinyMongo should follow the MongoDB/pymongo behaviour and throw the same error in the first case.