diff options
author | Eliot Horowitz <eliot@10gen.com> | 2012-11-14 00:17:52 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2012-11-14 00:17:52 -0500 |
commit | 80aaf5e73a4223b506c1630d6a7f3959acb3d840 (patch) | |
tree | 3dc1ef2568a1fbdb865b05a15f42ef7b57016f3f /jstests/find_and_modify_server7660.js | |
parent | 0027639682ee13763b75f15007710f371574131c (diff) | |
download | mongo-80aaf5e73a4223b506c1630d6a7f3959acb3d840.tar.gz |
SERVER-7660 findAndModify with auth + sort fix
Diffstat (limited to 'jstests/find_and_modify_server7660.js')
-rw-r--r-- | jstests/find_and_modify_server7660.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/jstests/find_and_modify_server7660.js b/jstests/find_and_modify_server7660.js new file mode 100644 index 00000000000..cae50d17dcc --- /dev/null +++ b/jstests/find_and_modify_server7660.js @@ -0,0 +1,18 @@ + +t = db.find_and_modify_server7660; +t.drop(); + +a = t.findAndModify({ + query : { foo : 'bar' }, + update : { $set : { bob : 'john' } }, + sort: { foo : 1}, + upsert: true, + new : true +}); + +b = t.findOne(); +assert.eq( a, b ); +assert.eq( "bar", a.foo ); +assert.eq( "john", a.bob ) + + |