Skip to content

Commit

Permalink
test(update): repro #5839
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Nov 28, 2017
1 parent 3a88543 commit 5e279f4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/model.update.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2835,6 +2835,24 @@ describe('model: update:', function() {
});
});

it('upsert: 1 (gh-5839)', function(done) {
var schema = new mongoose.Schema({
name: String
});

var Model = db.model('gh3677', schema);

var opts = { upsert: 1 };
Model.update({ name: 'Test' }, { name: 'Test2' }, opts, function(error) {
assert.ifError(error);
Model.findOne({}, function(error, doc) {
assert.ifError(error);
assert.equal(doc.name, 'Test2');
done();
});
});
});

it('update with nested id (gh-5640)', function(done) {
var testSchema = new mongoose.Schema({
_id: {
Expand Down

0 comments on commit 5e279f4

Please sign in to comment.