diff options
Diffstat (limited to 'jstests/core/where3.js')
-rw-r--r-- | jstests/core/where3.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/jstests/core/where3.js b/jstests/core/where3.js new file mode 100644 index 00000000000..c062ed11513 --- /dev/null +++ b/jstests/core/where3.js @@ -0,0 +1,10 @@ + +t = db.where3; +t.drop() + +t.save( { returned_date : 5 } ); +t.save( { returned_date : 6 } ); + +assert.eq( 1 , t.find( function(){ return this.returned_date == 5; } ).count() , "A" ); +assert.eq( 1 , t.find( { $where : "return this.returned_date == 5;" } ).count() , "B" ); +assert.eq( 1 , t.find( { $where : "this.returned_date == 5;" } ).count() , "C" ); |