diff options
Diffstat (limited to 'jstests/eval5.js')
-rw-r--r-- | jstests/eval5.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/jstests/eval5.js b/jstests/eval5.js new file mode 100644 index 00000000000..a9223a555a6 --- /dev/null +++ b/jstests/eval5.js @@ -0,0 +1,23 @@ + +t = db.eval5; +t.drop(); + +t.save( { a : 1 , b : 2 , c : 3 } ); + +assert.eq( 3 , + db.eval( + function(z){ + return db.eval5.find().toArray()[0].c; + } + ) , + "something weird A" + ); + +assert.isnull( + db.eval( + function(z){ + return db.eval5.find( {} , { a : 1 } ).toArray()[0].c; + } + ), + "field spec didn't work" + ); |