diff --git a/lib/collection.js b/lib/collection.js index 49edbdbe41..4f3a1d10cd 100644 --- a/lib/collection.js +++ b/lib/collection.js @@ -697,7 +697,15 @@ Collection.prototype.updateOne = function(filter, update, options, callback) { if (typeof options === 'function') (callback = options), (options = {}); options = options || {}; - const err = checkForAtomicOperators(update); + let err; + if (Array.isArray(update)) { + for (let i = 0; !err && i < update.length; i++) { + err = checkForAtomicOperators(update[i]); + } + } else { + err = checkForAtomicOperators(update); + } + if (err) { if (typeof callback === 'function') return callback(err); return this.s.promiseLibrary.reject(err);