denodrivers / mongo

🍃 MongoDB driver for Deno 🦕
https://deno.land/x/mongo
MIT License
508 stars 95 forks source link

Uncaught BSONError: cyclic dependency detected #379

Open oq-x opened 2 years ago

oq-x commented 2 years ago

Hey I am trying to use the package but I am getting this error. I am unsure how why and where this is coming from so here is some code I used with the package:

const panel = await panels.findOne({
      pId,
      guildId: interaction.guildId!.toString(),
    });
await panels.deleteOne({ pId, guildId: interaction.guildId?.toString() });
await panels.replaceOne({ pId: { $eq: panel.pId } }, panel);
const panels = await database.collection<Panel>("panels").countDocuments();
await panels.updateOne(panel, { $push: { blacklisted: { $each: [user] } } });
await panels.updateOne({ pId: { $eq: panel.pId } }, {
    $pull: { blacklisted: user },
  });
lucsoft commented 1 year ago

Can you still reproduce it from the current main branch?