Skip to content

Commit

Permalink
test: repro #9350
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Aug 23, 2020
1 parent 1256d77 commit 56fb748
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/model.test.js
Expand Up @@ -6869,6 +6869,23 @@ describe('Model', function() {
});
});

it('allows calling `create()` after `bulkWrite()` (gh-9350)', function() {
const schema = Schema({ foo: Boolean });
const Model = db.model('Test', schema);

return co(function*() {
yield Model.bulkWrite([
{ insertOne: { document: { foo: undefined } } },
{ updateOne: { filter: {}, update: { $set: { foo: true } } } }
]);

yield Model.create({ foo: undefined });

const docs = yield Model.find();
assert.equal(docs.length, 2);
});
});

describe('returnOriginal (gh-9183)', function() {
const originalValue = mongoose.get('returnOriginal');
beforeEach(() => {
Expand Down

0 comments on commit 56fb748

Please sign in to comment.