Details
-
Bug
-
Status: Closed
-
Minor - P4
-
Resolution: Fixed
-
2.2
-
None
-
None
-
Minor Change
Description
>>> from pymongo import Connection
|
>>> from bson.objectid import ObjectId
|
>>> c = Connection(safe=True)
|
>>> c.test.foo.insert({'_id':1})
|
1
|
>>> c.test.foo.insert({'_id':1}, safe=False)
|
Expected: no error, because 'safe' is False
Actual: DuplicateKeyError.
update() and insert() can be expected to override the collection's, database's, and connection's 'safe' setting same as for 'w' and other getLastError options, but don't for safe=False; only for safe=True.
Also, at least in Python 2.7.1,
Connection(wtimeout=1000, safe=False).safe
|