【发布时间】:2021-10-11 23:40:48
【问题描述】:
我知道这似乎是一个通用问题,但我已经进行了研究,但似乎没有用。我正在制作一个不和谐的机器人,但我对这种事情很陌生。我不断收到此错误UnhandledPromiseRejectionWarning: MongoError: E11000 duplicate key error collection: Data.users index
这是我使用的代码:
user.findOneAndUpdate({_id: msg.author, gold: 5});
这个问题的原因是什么以及如何解决?
【问题讨论】:
标签: javascript node.js mongoose discord.js