diff options
author | Matthew Russotto <matthew.russotto@10gen.com> | 2018-08-14 13:38:17 -0400 |
---|---|---|
committer | Matthew Russotto <matthew.russotto@10gen.com> | 2018-08-14 13:38:17 -0400 |
commit | 41005a73c8534953c4627b2a9d82a776e4276f1f (patch) | |
tree | a77a2466ab4d7ccc418880c44e0ba7ecca6f2ef0 /src/mongo/scripting | |
parent | 63c586c5571176a5a68d7d18e836e38e0a905211 (diff) | |
download | mongo-41005a73c8534953c4627b2a9d82a776e4276f1f.tar.gz |
SERVER-36094 Make DBClientBase::query() take an NamespaceStringOrUUID
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r-- | src/mongo/scripting/engine.cpp | 2 | ||||
-rw-r--r-- | src/mongo/scripting/mozjs/mongo.cpp | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/mongo/scripting/engine.cpp b/src/mongo/scripting/engine.cpp index 57a5d98f1e6..996225e5fbe 100644 --- a/src/mongo/scripting/engine.cpp +++ b/src/mongo/scripting/engine.cpp @@ -215,7 +215,7 @@ void Scope::loadStored(OperationContext* opCtx, bool ignoreNotConnected) { return; _loadedVersion = lastVersion; - string coll = _localDBName + ".system.js"; + NamespaceString coll(_localDBName, "system.js"); auto directDBClient = DBDirectClientFactory::get(opCtx).create(opCtx); 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()); |