我正在尝试使用以下语句将模型保存到mongo集合中
...
createRecord: (body) => {
console.log("Hello you are in createRecord : " );
let sEntry = new SAudit(Object.assign({}, body ));
console.log("Hello: " + body );
console.log("Hello before saving: " + sEntry );
return sEntry.save();
}
...
在这里,sEntry
仍然是空白,即使执行了Object.assign({}, body )
console.log
始终为空白
Hello before saving: { notes: [] }
好像我需要替换let sEntry = new SAudit(Object.assign({}, body ));