MongoDB. [Key Too Large To Index] MongoDB. [Key Too Large To Index] mongodb mongodb

MongoDB. [Key Too Large To Index]


Try to run your mongod process with this parameter:

sudo mongod --setParameter failIndexKeyTooLong=false

And than try again.


Since you can do some elaboration, you could extract some key words and put them in a field:

   _keywords : [ "mongodb" , "full search" , "nosql" ]

and make an index on that.


if you need to search text inside a large string you can use one of those:
keyword splitting
regular expression

the former has the downside that you need some "logic" to combine the keyword to make a search, the latter heavily impacts on performance.
probably if you really need full text search the best option is to use an external indexer like solr or lucene.