From d5122c9b90ef1f45585e09c45610488ff76894cf Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Mon, 8 Jun 2009 10:54:55 -0400 Subject: change Map to use Map.get Map.put Map[] won't work more tests for group --- jstests/group1.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 jstests/group1.js (limited to 'jstests/group1.js') diff --git a/jstests/group1.js b/jstests/group1.js new file mode 100644 index 00000000000..e7b1d5ef5d7 --- /dev/null +++ b/jstests/group1.js @@ -0,0 +1,17 @@ +t = db.group1; +t.drop(); + +t.save( { n : 1 , a : 1 } ); +t.save( { n : 2 , a : 1 } ); +t.save( { n : 3 , a : 2 } ); +t.save( { n : 4 , a : 2 } ); +t.save( { n : 5 , a : 2 } ); + + +res = t.group( { key : { a : true } , + reduce: function(obj,prev) { prev.count++; }, + initial: { count: 0 } + } + ); + +printjson( res ); -- cgit v1.2.1