E11000 duplicate key error collection: graylog.index_sets index: index_prefix_1 dup key: { index_prefix: "graylog" }

Hello There,

I was getting below error

E11000 duplicate key error collection: graylog.index_sets index: index_prefix_1 dup key: { index_prefix: “graylog” }

so I tried below

mongo
use graylog
show collections
db.index_sets.drop()

and issu resolved but I am not sure if its correct way or not, can someone guide me here.

Also when I was executing below
db.graylog.getIndexes()
I was getting below

It seems it it was null and i was not able to locate “index_prefix_1” so based on “graylog.index_sets” i removed collection called “index_sets” and it worked.

I just wanted to confirm what are the impact of this actions.

Regards,
SAM