summaryrefslogtreecommitdiff
path: root/jstests/eval2.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-02-20 10:54:28 -0500
committerEliot Horowitz <eliot@10gen.com>2009-02-20 10:54:28 -0500
commit77ccdaa8e557887ebe18351f3699b3b76c477df2 (patch)
tree2f7934caab7d6140a3eb2749d33662216924de94 /jstests/eval2.js
parent5f6aa4f67d9bf3bd6a4345db2af9c76647b677d2 (diff)
downloadmongo-77ccdaa8e557887ebe18351f3699b3b76c477df2.tar.gz
fixing tests
Diffstat (limited to 'jstests/eval2.js')
-rw-r--r--jstests/eval2.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/jstests/eval2.js b/jstests/eval2.js
new file mode 100644
index 00000000000..08dbcf65ee2
--- /dev/null
+++ b/jstests/eval2.js
@@ -0,0 +1,18 @@
+
+t = db.test;
+t.drop();
+t.save({a:1});
+t.save({a:1});
+
+var f = db.group(
+ {
+ ns: "test",
+ key: { a:true},
+ cond: { a:1 },
+ reduce: function(obj,prev) { prev.csum++; } ,
+ initial: { csum: 0}
+ }
+);
+
+assert(f[0].a == 1 && f[0].csum == 2);
+