Moved test jstest/[a-i].js -> jstests/core/ and made changes to comply with write command api
29 lines
513 B
JavaScript
29 lines
513 B
JavaScript
|
|
t = db.eval2;
|
|
t.drop();
|
|
t.save({a:1});
|
|
t.save({a:1});
|
|
|
|
var f = db.group(
|
|
{
|
|
ns: t.getName(),
|
|
key: { a:true},
|
|
cond: { a:1 },
|
|
reduce: function(obj,prev) { prev.csum++; } ,
|
|
initial: { csum: 0}
|
|
}
|
|
);
|
|
|
|
assert(f[0].a == 1 && f[0].csum == 2 , "on db" );
|
|
|
|
var f = t.group(
|
|
{
|
|
key: { a:true},
|
|
cond: { a:1 },
|
|
reduce: function(obj,prev) { prev.csum++; } ,
|
|
initial: { csum: 0}
|
|
}
|
|
);
|
|
|
|
assert(f[0].a == 1 && f[0].csum == 2 , "on coll" );
|