summaryrefslogtreecommitdiff
path: root/jstests/core/insert_id_undefined.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/insert_id_undefined.js')
-rw-r--r--jstests/core/insert_id_undefined.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/jstests/core/insert_id_undefined.js b/jstests/core/insert_id_undefined.js
new file mode 100644
index 00000000000..77d7d983549
--- /dev/null
+++ b/jstests/core/insert_id_undefined.js
@@ -0,0 +1,5 @@
+// ensure a document with _id undefined cannot be saved
+t = db.insert_id_undefined;
+t.drop();
+t.insert({_id:undefined});
+assert.eq(t.count(), 0);