-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hi there,
When I try to use the MongoBackend for a cache, I get the following error message:
message: the update operation document must contain atomic operators.
stack:
- MongoError: the update operation document must contain atomic operators.
- at Function.MongoError.create (/myapp/node_modules/mongodb-core/lib/error.js:45:10)
- at toError (/myapp/node_modules/mongodb/lib/utils.js:149:22)
- at checkForAtomicOperators (/myapp/node_modules/mongodb/lib/collection.js:852:12)
- at Collection.updateOne (/myapp/node_modules/mongodb/lib/collection.js:826:13)
- at /myapp/node_modules/stow/backends/mongo.js:40:18
- at MongoBackend.checksum (/myapp/node_modules/stow/backends/mongo.js:93:5)
- at MongoBackend.set (/myapp/node_modules/stow/backends/mongo.js:32:11)
- at Cache.set (/myapp/node_modules/stow/stow.js:53:16)
Looking at the code in that place, you're not using a $set operator in you update operation to replace the entire document.
Changing the method from updateOne to replaceOne fixes the issue. I'm opening a PR in a minute.
Metadata
Metadata
Assignees
Labels
No labels