diff options
Diffstat (limited to 'src/mongo/shell/crud_api.js')
-rw-r--r-- | src/mongo/shell/crud_api.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/shell/crud_api.js b/src/mongo/shell/crud_api.js index e9678cad16a..05f444b867b 100644 --- a/src/mongo/shell/crud_api.js +++ b/src/mongo/shell/crud_api.js @@ -667,7 +667,7 @@ DBCollection.prototype.updateMany = function(filter, update, options) { DBCollection.prototype.findOneAndDelete = function(filter, options) { var opts = Object.extend({}, options || {}); // Set up the command - var cmd = {query: filter, remove: true}; + var cmd = {query: filter || {}, remove: true}; if (opts.sort) { cmd.sort = opts.sort; @@ -725,7 +725,7 @@ DBCollection.prototype.findOneAndReplace = function(filter, replacement, options } // Set up the command - var cmd = {query: filter, update: replacement}; + var cmd = {query: filter || {}, update: replacement}; if (opts.sort) { cmd.sort = opts.sort; } @@ -790,7 +790,7 @@ DBCollection.prototype.findOneAndUpdate = function(filter, update, options) { } // Set up the command - var cmd = {query: filter, update: update}; + var cmd = {query: filter || {}, update: update}; if (opts.sort) { cmd.sort = opts.sort; } |