summaryrefslogtreecommitdiff
path: root/jstests/core/autoid.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/autoid.js')
-rw-r--r--jstests/core/autoid.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/jstests/core/autoid.js b/jstests/core/autoid.js
new file mode 100644
index 00000000000..6c8062fd093
--- /dev/null
+++ b/jstests/core/autoid.js
@@ -0,0 +1,11 @@
+f = db.jstests_autoid;
+f.drop();
+
+f.save( {z:1} );
+a = f.findOne( {z:1} );
+f.update( {z:1}, {z:2} );
+b = f.findOne( {z:2} );
+assert.eq( a._id.str, b._id.str );
+c = f.update( {z:2}, {z:"abcdefgabcdefgabcdefg"} );
+c = f.findOne( {} );
+assert.eq( a._id.str, c._id.str );