diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-06-04 08:49:06 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-06-04 08:49:06 -0400 |
commit | d7889fb311bdf7d174bbf2b9dc4bd5d1829c5c42 (patch) | |
tree | 43d769c9a3930ec2ab4c349b33cdb013aaa0b964 /jstests/sharding/shard6.js | |
parent | 7d9befe0e06a373a3212496993fa54f52948b4f1 (diff) | |
download | mongo-d7889fb311bdf7d174bbf2b9dc4bd5d1829c5c42.tar.gz |
Sharding: save() support SHARDING-17
Diffstat (limited to 'jstests/sharding/shard6.js')
-rw-r--r-- | jstests/sharding/shard6.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/sharding/shard6.js b/jstests/sharding/shard6.js index 88c809955b7..fab251bc2cf 100644 --- a/jstests/sharding/shard6.js +++ b/jstests/sharding/shard6.js @@ -20,4 +20,20 @@ for ( ; num<100; num++ ){ assert.eq( 100 , db.data.find().toArray().length ); +// limit + +assert.eq( 77 , db.data.find().limit(77).itcount() , "limit test 1" ); +assert.eq( 1 , db.data.find().limit(1).itcount() , "limit test 2" ); +for ( var i=1; i<10; i++ ){ + assert.eq( i , db.data.find().limit(i).itcount() , "limit test 3 : " + i ); +} + + +// --- test save support --- + +o = db.data.findOne(); +o.x = 16; +db.data.save( o ); +assert.eq( 16 , db.data.findOne( { _id : o._id } ).x , "x1 - did save fail?" ); + s.stop(); |