Skip to content

Commit 4bff372

Browse files
committed
Merge pull request #15 from petrjasek/develop
fix(mongo): let replace create new documents
2 parents 1ddaa00 + 7798860 commit 4bff372

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

eve/io/mongo/mongo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def replace(self, resource, id_, document):
428428
# have changed since the ETag was computed. This would require getting
429429
# the original document as an argument though.
430430
try:
431-
self.driver.db[datasource].update(filter_, document,
431+
self.driver.db[datasource].update(filter_, document, upsert=True,
432432
**self._wc(resource))
433433
except pymongo.errors.OperationFailure as e:
434434
# see comment in :func:`insert()`.

0 commit comments

Comments
 (0)