summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/dbcommands.cpp
diff options
context:
space:
mode:
authorTed Tuckman <ted.tuckman@mongodb.com>2019-11-15 19:50:52 +0000
committerevergreen <evergreen@mongodb.com>2019-11-15 19:50:52 +0000
commit6258369bc2d74e69a5e1fd8e025a291550aeb368 (patch)
treebe895955944d025eb4dd94f1771ef883cb3515cc /src/mongo/db/commands/dbcommands.cpp
parentab0e1e6875faa56155eb4777be66b575f6b48395 (diff)
downloadmongo-6258369bc2d74e69a5e1fd8e025a291550aeb368.tar.gz
SERVER-42693 Add renameAndPreserveOptions command and allow $out to output to different DB
Diffstat (limited to 'src/mongo/db/commands/dbcommands.cpp')
-rw-r--r--src/mongo/db/commands/dbcommands.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp
index 3db0141f5a5..e21d689045a 100644
--- a/src/mongo/db/commands/dbcommands.cpp
+++ b/src/mongo/db/commands/dbcommands.cpp
@@ -343,7 +343,9 @@ public:
if (cmd.getTemp()) {
uassert(ErrorCodes::InvalidOptions,
str::stream() << "the 'temp' field is an invalid option",
- opCtx->getClient()->isInDirectClient());
+ opCtx->getClient()->isInDirectClient() ||
+ (opCtx->getClient()->session()->getTags() |
+ transport::Session::kInternalClient));
}
// Validate _id index spec and fill in missing fields.