0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

switch machines

This commit is contained in:
Dwight 2008-03-31 08:35:28 -04:00
parent 93b8ffe183
commit b9666b4db1
2 changed files with 6 additions and 1 deletions

View File

@ -65,7 +65,10 @@ public:
strcpy(codeCopy,code);
func = JavaJS->functionCreate( code );
minilex.grabVariables(codeCopy, fields);
fullObject = fields.count("fullObject") > 0;
// if user references db, eg db.foo.save(obj),
// we make sure we have the whole thing.
fullObject = fields.count("fullObject") +
fields.count("db") > 0;
nFields = fields.size();
}

View File

@ -404,6 +404,8 @@ bool dbEval(JSObj& cmd, JSObjBuilder& result) {
Element args = cmd.findElement("args");
if( args.type() == Array ) {
JSObj eo = args.embeddedObject();
cout << "args:" << eo.toString() << endl;
cout << "code:\n" << code << endl;
s.setObject("args", eo);
}