Files
mongo/jstests/core/insert2.js
Max Hirschhorn 9ad8d6335f SERVER-40076 Tag JS tests with reason they're unable to run in Atlas.
There are likely more JavaScript tests which have been added since
r3.6.9 that still need to be tagged.

(cherry picked from commit 05ec08fa62)
2019-03-11 18:17:29 -04:00

22 lines
666 B
JavaScript

// Cannot implicitly shard accessed collections because of collection existing when none
// expected.
// @tags: [
// assumes_no_implicit_collection_creation_after_drop,
// requires_collstats,
// uses_multiple_connections,
// ]
// Create a new connection object so it won't affect the global connection when we modify
// it's settings.
var conn = new Mongo(db.getMongo().host);
conn.forceWriteMode(db.getMongo().writeMode());
t = conn.getDB(db.getName()).insert2;
t.drop();
assert.isnull(t.findOne(), "A");
assert.writeError(t.insert({z: 1, $inc: {x: 1}}, 0, true));
assert.isnull(t.findOne(), "B");
// Collection should not exist
assert.isnull(t.exists());