summaryrefslogtreecommitdiff
path: root/src/mongo/scripting/mozjs/mongo.cpp
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2018-08-14 13:38:17 -0400
committerMatthew Russotto <matthew.russotto@10gen.com>2018-08-14 13:38:17 -0400
commit41005a73c8534953c4627b2a9d82a776e4276f1f (patch)
treea77a2466ab4d7ccc418880c44e0ba7ecca6f2ef0 /src/mongo/scripting/mozjs/mongo.cpp
parent63c586c5571176a5a68d7d18e836e38e0a905211 (diff)
downloadmongo-41005a73c8534953c4627b2a9d82a776e4276f1f.tar.gz
SERVER-36094 Make DBClientBase::query() take an NamespaceStringOrUUID
Diffstat (limited to 'src/mongo/scripting/mozjs/mongo.cpp')
-rw-r--r--src/mongo/scripting/mozjs/mongo.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mongo/scripting/mozjs/mongo.cpp b/src/mongo/scripting/mozjs/mongo.cpp
index 0b88d21fb60..14a9cc8972a 100644
--- a/src/mongo/scripting/mozjs/mongo.cpp
+++ b/src/mongo/scripting/mozjs/mongo.cpp
@@ -291,8 +291,13 @@ void MongoBase::Functions::find::call(JSContext* cx, JS::CallArgs args) {
// The shell only calls this method when it wants to test OP_QUERY.
options |= DBClientCursor::QueryOptionLocal_forceOpQuery;
- std::unique_ptr<DBClientCursor> cursor(
- conn->query(ns, q, nToReturn, nToSkip, haveFields ? &fields : NULL, options, batchSize));
+ std::unique_ptr<DBClientCursor> cursor(conn->query(NamespaceString(ns),
+ q,
+ nToReturn,
+ nToSkip,
+ haveFields ? &fields : NULL,
+ options,
+ batchSize));
if (!cursor.get()) {
uasserted(ErrorCodes::InternalError, "error doing query: failed");
}
@@ -490,7 +495,7 @@ void MongoBase::Functions::cursorFromId::call(JSContext* cx, JS::CallArgs args)
// The shell only calls this method when it wants to test OP_GETMORE.
auto cursor = stdx::make_unique<DBClientCursor>(
- conn, ns, cursorId, 0, DBClientCursor::QueryOptionLocal_forceOpQuery);
+ conn, NamespaceString(ns), cursorId, 0, DBClientCursor::QueryOptionLocal_forceOpQuery);
if (args.get(2).isNumber())
cursor->setBatchSize(ValueWriter(cx, args.get(2)).toInt32());