{"size": 1592, "ext": "js", "max_stars_repo_path": "dist/test_ts/test-write-concern.js", "max_stars_repo_name": "prabhu/mongots", "max_stars_repo_stars_event_min_datetime": "2015-04-08T19:05:09.000Z", "max_stars_repo_stars_event_max_datetime": "2019-07-22T02:50:51.000Z", "max_issues_repo_path": "dist/test_ts/test-write-concern.js", "max_issues_repo_name": "prabhu/mongots", "max_issues_repo_issues_event_min_datetime": "2015-12-02T10:52:43.000Z", "max_issues_repo_issues_event_max_datetime": "2018-10-24T12:42:49.000Z", "max_forks_repo_path": "dist/test_ts/test-write-concern.js", "max_forks_repo_name": "prabhu/mongots", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 17, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 45.4857142857, "max_line_length": 115, "alphanum_fraction": 0.5502512563}
var assert = require('assert');
var mongots = require('../index');
var db = mongots('tstest', ['test123']);
describe("Write concern test", function () {
    it("should insert with write concern option", function () {
        db.test123.insert({ foo: 'bar' }, { writeConcern: { w: 0 } }, function (err) {
            assert.ok(!err, 'Insert operation has failed');
        });
    });
    it("should insert with write concern option and ordered", function () {
        db.test123.insert({ foo: 'bar' }, { writeConcern: { w: 0 }, ordered: true }, function (err) {
            assert.ok(!err, 'Insert operation has failed');
        });
    });
    it("should update with write concern option", function () {
        db.test123.update({ foo: 'bar' }, { $set: { foo: 'newbar' } }, { writeConcern: { w: 0 } }, function (err) {
            assert.ok(!err, 'Update operation has failed');
        });
    });
    it("should save with write concern option", function () {
        db.test123.save({ foo: 'bar' }, function (err, doc) {
            assert.ok(!err);
            assert.ok(doc._id);
            db.test123.save({ _id: doc._id, foo: 'newbar' }, { writeConcern: { w: 1 } }, function (err, ndoc) {
                assert.ok(!err, 'Update operation has failed');
            });
        });
    });
    it("should remove with write concern option and ordered", function () {
        db.test123.remove({ foo: 'bar' }, { writeConcern: { w: 1 } }, function (err) {
            assert.ok(!err, 'Remove operation has failed');
        });
    });
});
//# sourceMappingURL=test-write-concern.js.map