summaryrefslogtreecommitdiff
path: root/jstests/eval5.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-05-09 10:23:44 -0400
committerEliot Horowitz <eliot@10gen.com>2009-05-09 10:23:44 -0400
commit0422e9a22489718b8be1e0e1d07e805018151df9 (patch)
treec8479a05c898debb3ebdd6dfe875f1285dcb140c /jstests/eval5.js
parenta83e3bb41d67b64e43c166410f946df07ee36a32 (diff)
downloadmongo-0422e9a22489718b8be1e0e1d07e805018151df9.tar.gz
Spider Monkey: find field spec
Diffstat (limited to 'jstests/eval5.js')
-rw-r--r--jstests/eval5.js23
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"
+ );