mirror of
https://github.com/thinkjs/thinkjs.git
synced 2026-01-25 14:42:47 +00:00
Fix: fix addMany error on mongo model
This commit is contained in:
parent
34de1bfa43
commit
668d4f3746
@ -422,6 +422,14 @@ export default class extends think.base {
|
||||
* @return {} []
|
||||
*/
|
||||
beforeAdd(data){
|
||||
|
||||
//for addMany invoked
|
||||
if(think.isArray(data)){
|
||||
return data.map(item => {
|
||||
return this.beforeAdd(item);
|
||||
});
|
||||
}
|
||||
|
||||
let ret = {};
|
||||
//fields in schema
|
||||
for(let field in this.schema){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user