$where fix

This commit is contained in:
Eliot Horowitz
2009-01-29 15:58:54 -05:00
parent bf904dc9ec
commit 4a01d610ad
3 changed files with 10 additions and 4 deletions

View File

@@ -167,7 +167,10 @@ Local<v8::Object> mongoToV8( BSONObj & m , bool array ){
void v8ToMongoElement( BSONObjBuilder & b , v8::Handle<v8::String> name , const string sname , v8::Handle<v8::Value> value ){
if ( value->IsString() ){
b.append( sname.c_str() , toSTLString( value ).c_str() );
if ( sname == "$where" )
b.appendCode( sname.c_str() , toSTLString( value ).c_str() );
else
b.append( sname.c_str() , toSTLString( value ).c_str() );
return;
}