summaryrefslogtreecommitdiff
path: root/src/mongo/scripting/v8-3.25_db.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/scripting/v8-3.25_db.cpp')
-rw-r--r--src/mongo/scripting/v8-3.25_db.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/mongo/scripting/v8-3.25_db.cpp b/src/mongo/scripting/v8-3.25_db.cpp
index f4fe7d6a88d..147dcbbf563 100644
--- a/src/mongo/scripting/v8-3.25_db.cpp
+++ b/src/mongo/scripting/v8-3.25_db.cpp
@@ -31,7 +31,6 @@
#include <iostream>
#include <iomanip>
-#include <boost/shared_ptr.hpp>
#include "mongo/base/init.h"
#include "mongo/client/sasl_client_authenticate.h"
@@ -46,7 +45,7 @@
using namespace std;
using std::unique_ptr;
-using boost::shared_ptr;
+using std::shared_ptr;
namespace mongo {
@@ -186,14 +185,14 @@ namespace mongo {
return v8::Undefined(scope->getIsolate());
}
- boost::shared_ptr<mongo::DBClientBase> getConnection(V8Scope* scope,
+ std::shared_ptr<mongo::DBClientBase> getConnection(V8Scope* scope,
const v8::FunctionCallbackInfo<v8::Value>& args) {
verify(scope->MongoFT()->HasInstance(args.This()));
verify(args.This()->InternalFieldCount() == 1);
v8::Local<v8::External> c =
v8::Local<v8::External>::Cast(args.This()->GetInternalField(0));
- boost::shared_ptr<DBClientBase>* conn =
- static_cast<boost::shared_ptr<DBClientBase>*>(c->Value());
+ std::shared_ptr<DBClientBase>* conn =
+ static_cast<std::shared_ptr<DBClientBase>*>(c->Value());
massert(16667, "Unable to get db client connection", conn && conn->get());
return *conn;
}
@@ -205,7 +204,7 @@ namespace mongo {
const v8::FunctionCallbackInfo<v8::Value>& args) {
argumentCheck(args.Length() == 7, "find needs 7 args")
argumentCheck(args[1]->IsObject(), "needs to be an object")
- boost::shared_ptr<DBClientBase> conn = getConnection(scope, args);
+ std::shared_ptr<DBClientBase> conn = getConnection(scope, args);
const string ns = toSTLString(args[0]);
BSONObj fields;
BSONObj q = scope->v8ToMongo(args[1]->ToObject());
@@ -214,7 +213,7 @@ namespace mongo {
if (haveFields)
fields = scope->v8ToMongo(args[2]->ToObject());
- boost::shared_ptr<mongo::DBClientCursor> cursor;
+ std::shared_ptr<mongo::DBClientCursor> cursor;
int nToReturn = args[3]->Int32Value();
int nToSkip = args[4]->Int32Value();
int batchSize = args[5]->Int32Value();
@@ -239,11 +238,11 @@ namespace mongo {
argumentCheck(scope->NumberLongFT()->HasInstance(args[1]), "2nd arg must be a NumberLong")
argumentCheck(args[2]->IsUndefined() || args[2]->IsNumber(), "3rd arg must be a js Number")
- boost::shared_ptr<DBClientBase> conn = getConnection(scope, args);
+ std::shared_ptr<DBClientBase> conn = getConnection(scope, args);
const string ns = toSTLString(args[0]);
long long cursorId = numberLongVal(scope, args[1]->ToObject());
- boost::shared_ptr<mongo::DBClientCursor> cursor(
+ std::shared_ptr<mongo::DBClientCursor> cursor(
new DBClientCursor(conn.get(), ns, cursorId, 0, 0));
if (!args[2]->IsUndefined())
@@ -268,7 +267,7 @@ namespace mongo {
return v8AssertionException("js db in read only mode");
}
- boost::shared_ptr<DBClientBase> conn = getConnection(scope, args);
+ std::shared_ptr<DBClientBase> conn = getConnection(scope, args);
const string ns = toSTLString(args[0]);
v8::Local<v8::Integer> flags = args[2]->ToInteger();
@@ -317,7 +316,7 @@ namespace mongo {
return v8AssertionException("js db in read only mode");
}
- boost::shared_ptr<DBClientBase> conn = getConnection(scope, args);
+ std::shared_ptr<DBClientBase> conn = getConnection(scope, args);
const string ns = toSTLString(args[0]);
v8::Local<v8::Object> in = args[1]->ToObject();
@@ -344,7 +343,7 @@ namespace mongo {
return v8AssertionException("js db in read only mode");
}
- boost::shared_ptr<DBClientBase> conn = getConnection(scope, args);
+ std::shared_ptr<DBClientBase> conn = getConnection(scope, args);
const string ns = toSTLString(args[0]);
v8::Local<v8::Object> q = args[1]->ToObject();
@@ -361,7 +360,7 @@ namespace mongo {
v8::Local<v8::Value> mongoAuth(V8Scope* scope,
const v8::FunctionCallbackInfo<v8::Value>& args) {
- boost::shared_ptr<DBClientBase> conn = getConnection(scope, args);
+ std::shared_ptr<DBClientBase> conn = getConnection(scope, args);
if (NULL == conn)
return v8AssertionException("no connection");
@@ -391,7 +390,7 @@ namespace mongo {
v8::Local<v8::Value> mongoLogout(V8Scope* scope,
const v8::FunctionCallbackInfo<v8::Value>& args) {
argumentCheck(args.Length() == 1, "logout needs 1 arg")
- boost::shared_ptr<DBClientBase> conn = getConnection(scope, args);
+ std::shared_ptr<DBClientBase> conn = getConnection(scope, args);
const string db = toSTLString(args[0]);
BSONObj ret;
conn->logout(db, ret);