diff --git a/types/mongoose/mongoose-tests.ts b/types/mongoose/mongoose-tests.ts index 0e8ade55ed..8530aa5717 100644 --- a/types/mongoose/mongoose-tests.ts +++ b/types/mongoose/mongoose-tests.ts @@ -1213,12 +1213,13 @@ MongoModel.find({}).$where('indexOf("val") !== -1').exec(function (err, docs) { docs[0].__v; }); MongoModel.findById(999, function (err, doc) { + var handleSave = function(err: Error, product: mongoose.Document, numAffected: number) {}; doc.increment(); - doc.save(cb).then(cb).catch(cb); - doc.save({ validateBeforeSave: false }, cb).then(cb).catch(cb); - doc.save({ safe: true }, cb).then(cb).catch(cb); - doc.save({ safe: { w: 2, j: true } }, cb).then(cb).catch(cb); - doc.save({ safe: { w: 'majority', wtimeout: 10000 } }, cb).then(cb).catch(cb); + doc.save(handleSave).then(cb).catch(cb); + doc.save({ validateBeforeSave: false }, handleSave).then(cb).catch(cb); + doc.save({ safe: true }, handleSave).then(cb).catch(cb); + doc.save({ safe: { w: 2, j: true } }, handleSave).then(cb).catch(cb); + doc.save({ safe: { w: 'majority', wtimeout: 10000 } }, handleSave).then(cb).catch(cb); }); MongoModel = (new MongoModel()).model('MongoModel'); var mongoModel = new MongoModel();