diff options
Diffstat (limited to 'jstests/js1.js')
| -rw-r--r-- | jstests/js1.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/jstests/js1.js b/jstests/js1.js new file mode 100644 index 00000000000..240d9f82fbb --- /dev/null +++ b/jstests/js1.js @@ -0,0 +1,12 @@ + + +t = db.jstests_js1; +t.remove( {} ); + +t.save( { z : 1 } ); +t.save( { z : 2 } ); +assert( 2 == t.find().length() ); +assert( 2 == t.find( { $where : function(){ return 1; } } ).length() ); +assert( 1 == t.find( { $where : function(){ return obj.z == 2; } } ).length() ); + +assert(t.validate().valid); |
