summaryrefslogtreecommitdiff
path: root/jstests/core/where2.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/where2.js')
-rw-r--r--jstests/core/where2.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/jstests/core/where2.js b/jstests/core/where2.js
new file mode 100644
index 00000000000..9262b3076b3
--- /dev/null
+++ b/jstests/core/where2.js
@@ -0,0 +1,10 @@
+
+t = db.getCollection( "where2" );
+t.drop();
+
+t.save( { a : 1 } );
+t.save( { a : 2 } );
+t.save( { a : 3 } );
+
+assert.eq( 1 , t.find( { $where : "this.a == 2" } ).toArray().length , "A" );
+assert.eq( 1 , t.find( { $where : "\nthis.a == 2" } ).toArray().length , "B" );