mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
adds __v property to document
This commit is contained in:
@@ -1081,6 +1081,7 @@ var MongoModel = mongoose.model('MongoModel', new mongoose.Schema({
|
||||
}), 'myCollection', true);
|
||||
MongoModel.find({}).$where('indexOf("val") !== -1').exec(function (err, docs) {
|
||||
docs[0].save();
|
||||
docs[0].__v;
|
||||
});
|
||||
MongoModel.findById(999, function (err, doc) {
|
||||
doc.increment();
|
||||
|
||||
6
mongoose/mongoose.d.ts
vendored
6
mongoose/mongoose.d.ts
vendored
@@ -2332,6 +2332,12 @@ declare module "mongoose" {
|
||||
* @param fn optional callback
|
||||
*/
|
||||
save(fn?: (err: any, product: this, numAffected: number) => void): Promise<this>;
|
||||
|
||||
/**
|
||||
* Version using default version key. See http://mongoosejs.com/docs/guide.html#versionKey
|
||||
* If you're using another key, you will have to access it using []: doc[_myVersionKey]
|
||||
*/
|
||||
__v?: number;
|
||||
}
|
||||
|
||||
interface ModelProperties {
|
||||
|
||||
Reference in New Issue
Block a user