summaryrefslogtreecommitdiff
path: root/jstests/core/insert_id_undefined.js
blob: 874d6c0228c2fab19dbc3d85d229254b39ff794e (plain)
1
2
3
4
5
6
7
// 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);
// Make sure the collection was not created
assert.commandFailed(t.stats());