blob: 5f6f29c0ec89173771c8d2e2ec97633dc59d267d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/**
* Explicit shell session should prohibit w: 0 writes.
*/
(function() {
"use strict";
const conn = MongoRunner.runMongod();
const session = conn.startSession();
const sessionColl = session.getDatabase("test").getCollection("foo");
const err = assert.throws(() => {
sessionColl.insert({x: 1}, {writeConcern: {w: 0}});
});
assert.includes(
err.toString(), "Unacknowledged writes are prohibited with sessions", "wrong error message");
session.endSession();
MongoRunner.stopMongod(conn);
})();
|