Sign In Register

How can we help you today?

Start a new topic

'Btree::insert: key too large to index

I'm trying to save an object to my collection but I'm getting this error

Write failed with error code 17280 and error message 'Btree::insert: key too large to index

It was working before but then I added a key to track all the ids within to prevent duplicates and that's when this error started occurring. I thought maybe the value of this combinedId key was too long so I even hashed it and still get the error.
The biggest head scratcher is that if I delete the key before saving it I still get this error now.

Now if I set one or the other documents to null it does save.

Any idea what's causing this? It's just a combination of two documents with some community data (likes or votes etc). Is it really that big because it was working before (saving both documents) and the documents for Challenges and Players are much bigger than this and contain magnitudes larger of the same data in just on of what I'm trying to save.

Thanks for your time!


Can you give us an example of an object that is causing the error when you are trying to insert it ? 



Submitted a suport ticket with the info

 I have the same error

Write failed with error code 17280 and error message 'Btree::insert: key too large to index, failing

 this error has blocked all the work


 Hey Alex,

Do you have any indexes on that collection?
This error is associated with the content/docs in a collection being to large an index.

If you can send us a list of indexes we can help. The limit to an index is ~1k and its a good idea not to index strings because of this.


Now the indices of such



 v: 1 key: _id: 1 name: "_id_" ns: "308439-game-preview.script.PF"



 v: 1 key: armada: 1 _id: 1 name: "armada_1__id_1" ns: "308439-game-preview.script.PF" background: true



 v: 1 key: sys: 1 name: "sys_1" ns: "308439-game-preview.script.PF" background: true



 v: 1 key: armada: 1 _id: 1 f5: 1 name: "armada_1__id_1_f5_1" ns: "308439-game-preview.script.PF" background: true



 v: 1 key: armada: 1 PlayerName: 1 _id: 1 name: "armada_1_PlayerName_1__id_1" ns: "308439-game-preview.script.PF" background: true

 Could you send on an example of a doc you are trying to insert into that collection?
How many docs do you have in that collection at the moment?



Do you have any idea how not to index strings in collection? I want to save long string but I get this error:('Btree::insert: key too large to index....).



Login to post a comment