summaryrefslogtreecommitdiff
path: root/jstests/core/insert_id_undefined.js
blob: 5dc2c9a686239a777e4979646454b784b413d458 (plain)
1
2
3
4
5
6
7
8
9
10
11
// Cannot implicitly shard accessed collections because of collection existing when none
// expected.
// @tags: [assumes_no_implicit_collection_creation_after_drop]

// 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());