I am executing the following code inside a post request:
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);
}
and I am getting the circular dependency error.
When I comment out the following line, everything works fine.
await db.collection('LoggedInUser').updateOne({ userId: _id }, { '$set': {
'isLoggedIn': true } }, { upsert: true });
Kindly let me know what may be the issue here and how to rectify it.