Skip to content

Commit

Permalink
test(query): repro #4609
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Oct 23, 2016
1 parent 8d26dea commit 0459851
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/model.update.test.js
Expand Up @@ -2015,6 +2015,26 @@ describe('model: update:', function() {
});
});

it('update with buffer and exec (gh-4609)', function(done) {
var arrSchema = new Schema({
ip: mongoose.SchemaTypes.Buffer
});
var schema = new Schema({
arr: [arrSchema]
});

var M = db.model('gh4609', schema);

var m = new M({ arr: [{ ip: new Buffer(1) }] });
m.save(function(error, m) {
assert.ifError(error);
m.update({ $push: { arr: { ip: new Buffer(1) } } }).exec(function(error, doc) {
assert.ifError(error);
done();
});
});
});

it('update handles casting with mongoose-long (gh-4283)', function(done) {
require('mongoose-long')(mongoose);

Expand Down

0 comments on commit 0459851

Please sign in to comment.