Updates with no operator should default to $set Fix #667

This commit is contained in:
Bruno Rocha
2014-07-02 14:39:29 -03:00
parent 21818e71f5
commit 99e943c365
3 changed files with 14 additions and 2 deletions

View File

@@ -525,6 +525,13 @@ modifier comes before the field, not after it::
>>> post.tags
['database', 'nosql']
.. note::
If no modifier operator is specified the default will be `set` the both following sentences are identical::
>>> BlogPost.objects(id=post.id).update(title='Example Post')
>>> BlogPost.objects(id=post.id).update(set__title='Example Post')
.. note::
In version 0.5 the :meth:`~mongoengine.Document.save` runs atomic updates