【发布时间】:2019-08-07 06:46:24
【问题描述】:
我在 post 请求中执行以下代码:
try{
const _id = await db.collection('UserInformation').insertOne(userObj);
await db.collection('LoggedInUser').updateOne({ userId: _id }, { '$set': {
'isLoggedIn': true } }, { upsert: true });
}
catch(e){
console.log(e);
}
我得到循环依赖错误。
当我注释掉以下行时,一切正常。
await db.collection('LoggedInUser').updateOne({ userId: _id }, { '$set': {
'isLoggedIn': true } }, { upsert: true });
请让我知道这里可能存在什么问题以及如何纠正它。
【问题讨论】:
标签: node.js mongodb typescript