Update mongo.js

增加 beforeUpadte
This commit is contained in:
ken 2016-04-15 16:32:27 +08:00
parent 69b0d09d96
commit a5ec3abcad

View File

@ -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();
});
}
}
}