summaryrefslogtreecommitdiff
path: root/jstests/js9.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/js9.js')
-rw-r--r--jstests/js9.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/jstests/js9.js b/jstests/js9.js
new file mode 100644
index 00000000000..8748667f527
--- /dev/null
+++ b/jstests/js9.js
@@ -0,0 +1,24 @@
+c = db.jstests_js9;
+c.drop();
+
+c.save( { a : 1 } );
+c.save( { a : 2 } );
+
+
+assert.eq( 2 , c.find().length() );
+assert.eq( 2 , c.find().count() );
+
+
+assert.eq( 2 ,
+ db.eval(
+ function(){
+ num = 0;
+ db.jstests_js9.find().forEach(
+ function(z){
+ num++;
+ }
+ );
+ return num;
+ }
+ )
+ )