diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-01-24 01:43:08 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-01-24 01:43:25 -0500 |
commit | 6dd4315ccbb2897b7e5f0943882f2bf57a87d37d (patch) | |
tree | 9ea190a6337a869be7b92a309cdabbd8f8e510e7 /scripting | |
parent | bcab1f1ab1ac66797924256c0bef7cba2826edb5 (diff) | |
download | mongo-6dd4315ccbb2897b7e5f0943882f2bf57a87d37d.tar.gz |
sharding check for v8
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/v8_db.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripting/v8_db.cpp b/scripting/v8_db.cpp index 5fe80ce445b..c19bddd44de 100644 --- a/scripting/v8_db.cpp +++ b/scripting/v8_db.cpp @@ -22,6 +22,7 @@ #include "util/base64.h" #include "util/text.h" #include "../client/syncclusterconnection.h" +#include "../s/d_logic.h" #include <iostream> using namespace std; @@ -463,6 +464,9 @@ namespace mongo { args.This()->Set( v8::String::New( "_db" ) , args[1] ); args.This()->Set( v8::String::New( "_shortName" ) , args[2] ); args.This()->Set( v8::String::New( "_fullName" ) , args[3] ); + + if ( haveLocalShardingInfo( toSTLString( args[3] ) ) ) + return v8::ThrowException( v8::String::New( "can't use sharded collection from db.eval" ) ); for ( int i=0; i<args.Length(); i++ ) assert( ! args[i]->IsUndefined() ); |