Files
mongo/jstests/core/insert_id_undefined.js

8 lines
225 B
JavaScript
Raw Normal View History

2013-08-28 13:25:48 -04:00
// 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() );