summaryrefslogtreecommitdiff
path: root/shell/MongoJS.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shell/MongoJS.cpp')
-rw-r--r--shell/MongoJS.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/shell/MongoJS.cpp b/shell/MongoJS.cpp
index 8184e80db63..3fbdc999ca1 100644
--- a/shell/MongoJS.cpp
+++ b/shell/MongoJS.cpp
@@ -260,7 +260,11 @@ BSONObj v8ToMongo( v8::Handle<v8::Object> o ){
return b.obj();
}
+#ifdef _WIN32
+#define GETNS char * ns = new char[args[0]->ToString()->Utf8Length()]; args[0]->ToString()->WriteUtf8( ns );
+#else
#define GETNS char ns[args[0]->ToString()->Utf8Length()]; args[0]->ToString()->WriteUtf8( ns );
+#endif
DBClientConnection * getConnection( const Arguments& args ){
Local<External> c = External::Cast( *(args.This()->Get( CONN_STRING )) );
@@ -316,7 +320,7 @@ v8::Handle<v8::Value> mongoInsert(const v8::Arguments& args){
v8::Handle<v8::Object> in = args[1]->ToObject();
if ( ! in->Has( String::New( "_id" ) ) ){
- v8::Handle<v8::Value> argv[0];
+ v8::Handle<v8::Value> argv[1];
in->Set( String::New( "_id" ) , getObjectIdCons()->NewInstance( 0 , argv ) );
}