Clarify unack'd write concern not returning the deleted count [ci skip]

This commit is contained in:
Stefan Wojcik
2019-06-26 15:14:43 +02:00
parent ffedd33101
commit 91899acfe5
2 changed files with 9 additions and 1 deletions

View File

@@ -483,6 +483,10 @@ class BaseQuerySet(object):
with set_write_concern(queryset._collection, write_concern) as collection:
result = collection.delete_many(queryset._query)
# If we're using an unack'd write concern, we don't really know how
# many items have been deleted at this point, hence we only return
# the count for ack'd ops.
if result.acknowledged:
return result.deleted_count