在保存文档mongodb时出现错误:“ 170375”,_ id? 如何解决此问题,我现在不知道确切原因是什么
sub.paymentObj.status = 'pending';
sub.paymentObj.paymentState = result.state;
sub.paymentObj.paymentId = result.id;
sub.save().then((savedSub) =>{
if (!savedSub) return reject({ message:'Fail update subscription' });
return resolve({ url: savedSub.paymentObj.paymentUrl });
}).catch((err) => {
return reject({ message: err.message })
});
错误响应
Error: "170375", _id
at model.checkError (/Users/...../node_modules/plugins/mongoose_errorhandler.js:8:18)
at next (/Users/...../node_modules/kareem/index.js:149:14)
at Kareem.execPost (/Users/...../node_modules/kareem/index.js:197:3)
at /Users/...../node_modules/mongoose/lib/model.js:227:35
at /Users/...../node_modules/mongoose/lib/model.js:201:11
at handleCallback (/Users/...../node_modules/mongoose/node_modules/mongodb/lib/utils.js:120:56)
at /Users/...../node_modules/mongoose/node_modules/mongodb/lib/collection.js:1059:42
at /Users/...../node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:469:18
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)