summaryrefslogtreecommitdiff
path: root/src/mongo/shell/crud_api.js
diff options
context:
space:
mode:
authorJames Wahlin <james.wahlin@mongodb.com>2019-09-11 21:03:31 +0000
committerevergreen <evergreen@mongodb.com>2019-09-11 21:03:31 +0000
commitf57dacda0dedbe206e4215d7fe0a7685d587cfe0 (patch)
tree3633302a8b32eb661845626fdf2e6ffbc48ea98f /src/mongo/shell/crud_api.js
parent8e126c6a98757570779fd24050176d91070f2b1f (diff)
downloadmongo-f57dacda0dedbe206e4215d7fe0a7685d587cfe0.tar.gz
SERVER-42608 Accept hint in shell helper updateOne and updateMany
(cherry picked from commit 590f4e148ac14bda1fc1e21b4d173c3bc2d25da2)
Diffstat (limited to 'src/mongo/shell/crud_api.js')
-rw-r--r--src/mongo/shell/crud_api.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mongo/shell/crud_api.js b/src/mongo/shell/crud_api.js
index dd7d334291a..c428f461be8 100644
--- a/src/mongo/shell/crud_api.js
+++ b/src/mongo/shell/crud_api.js
@@ -115,6 +115,10 @@ DBCollection.prototype.bulkWrite = function(operations, options) {
operation = operation.upsert();
}
+ if (op.updateOne.hint) {
+ operation = operation.hint(op.updateOne.hint);
+ }
+
if (op.updateOne.collation) {
operation.collation(op.updateOne.collation);
}
@@ -139,6 +143,10 @@ DBCollection.prototype.bulkWrite = function(operations, options) {
operation = operation.upsert();
}
+ if (op.updateMany.hint) {
+ operation = operation.hint(op.updateMany.hint);
+ }
+
if (op.updateMany.collation) {
operation.collation(op.updateMany.collation);
}
@@ -565,6 +573,10 @@ DBCollection.prototype.updateOne = function(filter, update, options) {
op = op.upsert();
}
+ if (opts.hint) {
+ op.hint(opts.hint);
+ }
+
if (opts.collation) {
op.collation(opts.collation);
}
@@ -651,6 +663,10 @@ DBCollection.prototype.updateMany = function(filter, update, options) {
op = op.upsert();
}
+ if (opts.hint) {
+ op.hint(opts.hint);
+ }
+
if (opts.collation) {
op.collation(opts.collation);
}