2009-05-14 10:45:55 -04:00
|
|
|
|
|
|
|
|
t = db.query1;
|
|
|
|
|
t.drop();
|
|
|
|
|
|
|
|
|
|
t.save( { num : 1 } );
|
|
|
|
|
t.save( { num : 3 } )
|
|
|
|
|
t.save( { num : 4 } );
|
|
|
|
|
|
|
|
|
|
num = 0;
|
|
|
|
|
total = 0;
|
|
|
|
|
|
|
|
|
|
t.find().forEach(
|
|
|
|
|
function(z){
|
|
|
|
|
num++;
|
|
|
|
|
total += z.num;
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
assert.eq( num , 3 , "num" )
|
|
|
|
|
assert.eq( total , 8 , "total" )
|
2011-05-28 11:51:55 -04:00
|
|
|
|
2015-07-23 18:57:46 -04:00
|
|
|
assert.eq( 3 , t.find().comment("this is a test").itcount() , "B1" )
|
|
|
|
|
assert.eq( 3 , t.find().comment("this is a test").count() , "B2" )
|
2011-09-21 17:03:38 -04:00
|
|
|
|
2015-07-23 18:57:46 -04:00
|
|
|
assert.eq( 3 , t.find().comment("yo ho ho").itcount() , "C1" )
|
|
|
|
|
assert.eq( 3 , t.find().comment("this is a test").count() , "C2" )
|