While saving a collection MongoDB is creating Index name which is too long and exceeds 127 bytes limit. How to solve this. can i disable indexing?

后端 未结 2 2197
醉酒成梦
醉酒成梦 2021-02-20 10:25
com.mongodb.CommandFailureException: { \"serverUsed\" : \"localhost:27017\" , \"createdCollectionAutomatically\" : true , \"numIndexesBefore\" : 1 , \"ok\" : 0.0 , \"err         


        
2条回答
  •  生来不讨喜
    2021-02-20 11:07

    You can not disable indexing as MongoDB will always create an index for _id. Shorten your collection name instead - saves you some typing too

提交回复
热议问题