You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't be able to register through facebook once after i registered and logout out from google auth. Kindly someone help me to solve this issue!.
/////////////////////////////////////////////////////////////////////////////////////////////////////////
MongoServerError: E11000 duplicate key error collection: usersDB.users index: username_1 dup key: { username: null }
at E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\operations\insert.js:53:33
at E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\cmap\connection_pool.js:308:25
at E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\sdam\server.js:213:17
at handleOperationResult (E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\sdam\server.js:329:20)
at Connection.onMessage (E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\cmap\connection.js:219:9)
at MessageStream. (E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\cmap\connection.js:60:60)
at MessageStream.emit (node:events:527:28)
at processIncomingData (E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\cmap\message_stream.js:132:20)
at MessageStream._write (E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\cmap\message_stream.js:33:9)
at writeOrBuffer (node:internal/streams/writable:389:12) {
index: 0,
code: 11000,
keyPattern: { username: 1 },
keyValue: { username: null },
[Symbol(errorLabels)]: Set(0) {}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
The text was updated successfully, but these errors were encountered:
This is a monogo error. In your mongoose schema you maybe defined as username {type string, unique:true}. So when you are storing data in DB, only one null value for username will store. After that if username field has null value duplicate error will throw. Change username field as below
I couldn't be able to register through facebook once after i registered and logout out from google auth. Kindly someone help me to solve this issue!.
/////////////////////////////////////////////////////////////////////////////////////////////////////////
MongoServerError: E11000 duplicate key error collection: usersDB.users index: username_1 dup key: { username: null }
at E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\operations\insert.js:53:33
at E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\cmap\connection_pool.js:308:25
at E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\sdam\server.js:213:17
at handleOperationResult (E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\sdam\server.js:329:20)
at Connection.onMessage (E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\cmap\connection.js:219:9)
at MessageStream. (E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\cmap\connection.js:60:60)
at MessageStream.emit (node:events:527:28)
at processIncomingData (E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\cmap\message_stream.js:132:20)
at MessageStream._write (E:\backend-development\Secrets - Starting Code\node_modules\mongodb\lib\cmap\message_stream.js:33:9)
at writeOrBuffer (node:internal/streams/writable:389:12) {
index: 0,
code: 11000,
keyPattern: { username: 1 },
keyValue: { username: null },
[Symbol(errorLabels)]: Set(0) {}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
The text was updated successfully, but these errors were encountered: