support a negative dec operator (#1450)

This commit is contained in:
Stefan Wójcik
2016-12-28 02:04:49 -05:00
committed by GitHub
parent 91dad4060f
commit f4e1d80a87
2 changed files with 6 additions and 2 deletions

View File

@@ -233,8 +233,7 @@ def update(_doc_cls=None, **update):
# Support decrement by flipping a positive value's sign
# and using 'inc'
op = 'inc'
if value > 0:
value = -value
value = -value
elif op == 'add_to_set':
op = 'addToSet'
elif op == 'set_on_insert':