AnswerBun.com

duplicate key error index MongoDB

Database Administrators Asked by Simonell on December 16, 2020

I have rocket.chat server connected to LDAP.
When one of users try logging to their account he get logged to someone other account, it’s probably because indexes. My logs look like this:

[34mI20161126-12:07:28.992(1) rocketchat_ldap rocketchat_ldap.js:341 [31mLDAP ➔ Search.error Search by id 31353036 returned 2 records
[34mI20161126-12:07:28.999(1) rocketchat_ldap rocketchat_ldap.js:780

[31mLDAPSync ➔ error { [MongoError: E11000 duplicate key error index:
rocketchat.users.$emails.address_1 dup key: { : “[email protected]” }]
name: ‘MongoError’, message: ‘E11000 duplicate key error index:
rocketchat.users.$emails.address_1 dup key: { : “[email protected]” }’,
driver: true, index: 0, code: 11000, errmsg: ‘E11000 duplicate
key error index: rocketchat.users.$emails.address_1 dup key: { :
[email protected]” }’ }

Can I rebuild that indexes or something else to resolve this problem?

One Answer

I am not familiar with Rocket.Chat.

Will dare to suggest to check that MongoDB collection's indexes with db.collectionName.getIndexes() and see if there is an index with the email address field as unique index. If so, then, drop it with db.collectionName.dropIndex("indexName").

Answered by moalf on December 16, 2020

Add your own answers!

Related Questions

Counting rows from a subquery

3  Asked on November 14, 2021 by rwcommand

     

How to get the registers in the highest time of period

1  Asked on November 14, 2021 by wilson-eduardo-millan-vargas

 

Mix ;WITH NAMESPACES and schema collections?

1  Asked on November 14, 2021 by user1664043

   

MariaDB tmpdir & table copy operations

1  Asked on November 11, 2021 by user120053

 

SAP Oracle Full Online Backup Failing

1  Asked on November 11, 2021 by plamenbv

     

SQL Server Replication

1  Asked on November 8, 2021 by derek-czarny

       

Performance MySQL query with for loop

1  Asked on November 8, 2021 by fabian-sierra

       

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir