summaryrefslogtreecommitdiff
path: root/jstests/find_and_modify_server7660.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-11-14 00:17:52 -0500
committerEliot Horowitz <eliot@10gen.com>2012-11-14 00:17:52 -0500
commit80aaf5e73a4223b506c1630d6a7f3959acb3d840 (patch)
tree3dc1ef2568a1fbdb865b05a15f42ef7b57016f3f /jstests/find_and_modify_server7660.js
parent0027639682ee13763b75f15007710f371574131c (diff)
downloadmongo-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.js18
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 )
+
+