mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
@types/mongoose: following @simonxca advice and adding more tests
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user