Hi
HoangGun10102003 opened this issue · comments
MongoServerError: E11000 duplicate key error collection: myFirstDatabase.guilds index: guildId_1 dup key: { guildId: null }
at C:\Users\kirit\Downloads\Giveaway-main (1)\Giveaway-main\node_modules\mongodb\lib\operations\insert.js:53:33
at C:\Users\kirit\Downloads\Giveaway-main (1)\Giveaway-main\node_modules\mongodb\lib\cmap\connection_pool.js:299:25
at C:\Users\kirit\Downloads\Giveaway-main (1)\Giveaway-main\node_modules\mongodb\lib\sdam\server.js:212:17
at handleOperationResult (C:\Users\kirit\Downloads\Giveaway-main (1)\Giveaway-main\node_modules\mongodb\lib\sdam\server.js:284:20)
at Connection.onMessage (C:\Users\kirit\Downloads\Giveaway-main (1)\Giveaway-main\node_modules\mongodb\lib\cmap\connection.js:219:9)
at MessageStream. (C:\Users\kirit\Downloads\Giveaway-main (1)\Giveaway-main\node_modules\mongodb\lib\cmap\connection.js:60:60)
at MessageStream.emit (node:events:513:28)
at processIncomingData (C:\Users\kirit\Downloads\Giveaway-main (1)\Giveaway-main\node_modules\mongodb\lib\cmap\message_stream.js:132:20)
at MessageStream._write (C:\Users\kirit\Downloads\Giveaway-main (1)\Giveaway-main\node_modules\mongodb\lib\cmap\message_stream.js:33:9)
at writeOrBuffer (node:internal/streams/writable:392:12) {
index: 0,
code: 11000,
keyPattern: { guildId: 1 },
keyValue: { guildId: null },
[Symbol(errorLabels)]: Set(0) {}
}
MongoServerError: E11000 duplicate key error collection: myFirstDatabase.guilds index: guildId_1 dup key: { guildId: null }
check this answers out. It might help u.
https://stackoverflow.com/questions/24430220/e11000-duplicate-key-error-index-in-mongodb-mongoose