summaryrefslogtreecommitdiff
path: root/shell/dbshell.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-05-13 17:27:45 -0400
committerEliot Horowitz <eliot@10gen.com>2009-05-13 17:27:45 -0400
commit4bf96beb17cdcb698a5711b87fde339a4a6efbe3 (patch)
tree0876e651f8a4ffea9abf225b98f6e41b7be020a3 /shell/dbshell.cpp
parent18c01987a239bbc32496c82aa08d117a9f352674 (diff)
downloadmongo-4bf96beb17cdcb698a5711b87fde339a4a6efbe3.tar.gz
Spider Monkey Shell: another checkpoint
Diffstat (limited to 'shell/dbshell.cpp')
-rw-r--r--shell/dbshell.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/shell/dbshell.cpp b/shell/dbshell.cpp
index edc083733b6..8e91911b106 100644
--- a/shell/dbshell.cpp
+++ b/shell/dbshell.cpp
@@ -238,30 +238,27 @@ int main(int argc, char* argv[]) {
break;
}
+
+ scope->externalSetup();
- /*
if ( !nodb ) { // connect to db
- v8::HandleScope handle_scope;
cout << "url: " << url << endl;
string setup = (string)"db = connect( \"" + fixHost( url , dbhost , port ) + "\")";
- if ( ! ExecuteString( v8::String::New( setup.c_str() ) , v8::String::New( "(connect)" ) , false , true ) ){
+ if ( ! scope->exec( setup , "(connect)" , false , true , false ) )
return -1;
- }
-
+
if ( username.size() && password.size() ){
stringstream ss;
ss << "if ( ! db.auth( \"" << username << "\" , \"" << password << "\" ) ){ throw 'login failed'; }";
- if ( ! ExecuteString( v8::String::New( ss.str().c_str() ) , v8::String::New( "(auth)" ) , true , true ) ){
+ if ( ! scope->exec( ss.str() , "(auth)" , true , true , false ) ){
cout << "login failed" << endl;
return -1;
}
-
}
}
- */
int numFiles = 0;