-
Notifications
You must be signed in to change notification settings - Fork 211
Description
Hi,
If I do:
MyModel.objects.update(title="blah blah")
The return value of the update() is None by default.
I am aware that this behaviour can be controlled with the "OPTIONS" element when setting the DB engine:
'default' : {
'ENGINE': 'django_mongodb_engine',
'NAME': 'test',
'OPTIONS': {'OPERATIONS': {'safe': True}}
},
.. and that doing so will make update() calls return the number of rows affected.
However, the documented Django behaviour is that this will return the number of rows affected. So the default behaviour of django_mongodb_engine differs from other drivers.
I would argue that safe mode should be the default, not an optional flag, such that the default behaviour is the same as sqlite, MySQL etc. If there is a performance reason for disabling "safe" updates then it seems more natural that people should have to explicitly disable safe mode with the caveat that they lose the "number of rows affected" return value as a trade-off.
Thanks.