mirror of
https://github.com/thinkjs/thinkjs.git
synced 2026-01-25 14:42:47 +00:00
Update mongo.js
增加 beforeUpadte
This commit is contained in:
parent
69b0d09d96
commit
a5ec3abcad
@ -176,6 +176,7 @@ export default class extends Base {
|
||||
this.where({[pk]: data[pk]});
|
||||
delete data[pk];
|
||||
}
|
||||
data = await this.beforeUpdate(data, options);
|
||||
let result = await this.db().update(data, options);
|
||||
await this.afterUpdate(data, options);
|
||||
return result.result.nModified || 0;
|
||||
@ -348,4 +349,4 @@ export default class extends Base {
|
||||
return collection.indexes();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user