add "safe" and "write_options" parameters to QuerySet.insert similar to Document.save

This commit is contained in:
Greg Banks
2012-04-26 13:56:52 -07:00
parent 2769d6d7ca
commit 0bb9781b91
3 changed files with 44 additions and 6 deletions

View File

@@ -147,8 +147,9 @@ class Document(BaseDocument):
:meth:`~pymongo.collection.Collection.save` OR
:meth:`~pymongo.collection.Collection.insert`
which will be used as options for the resultant ``getLastError`` command.
For example, ``save(..., w=2, fsync=True)`` will wait until at least two servers
have recorded the write and will force an fsync on each server being written to.
For example, ``save(..., write_options={w: 2, fsync: True}, ...)`` will
wait until at least two servers have recorded the write and will force an
fsync on each server being written to.
:param cascade: Sets the flag for cascading saves. You can set a default by setting
"cascade" in the document __meta__
:param cascade_kwargs: optional kwargs dictionary to be passed throw to cascading saves