Error in monogdb "errmsg": "WiredTigerIndex :: insert: key too large for indexing, failure
2 answers
In MongoDB since version 2.6, the total index record size must be less than 1024 bytes. Documentation here
In other words, at least one of your documents is significant in one of the fields you are trying to index.
It is not a good idea in general to index very large values ββlike this, because it creates a large index that is less efficient compared to a smaller one, and takes up more RAM space that could be better used on a MongoDB node.
You can use this: mongod --setParameter failIndexKeyTooLong=false
.
But that doesn't sound like a good idea. If you have large text to index, you should consider using the Full Text index, or you can use the Hashed index.
+3
source to share