Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firestore index limitation for document

According to Firestore documentation about index limitations:

Maximum sum of the following for a document: 20,000

  • The number of single-field index entries

  • The number of composite index entries

I can't understand what is that means. Is it:

  • Single document will not be indexed more than 20,000 time for different indexes.
  • OR, collection to have index should not be more than 20,000 document
like image 958
Mohammad Shraim Avatar asked Dec 22 '25 09:12

Mohammad Shraim


1 Answers

Update: The limit is now 40,000 index entries per document.

This limit affects the maximum number of fields you can index for each document. For example, Cloud Firestore automatically creates an ascending single-field index entry and a descending single-field index entry for each string field. A document with only string fields and no composite indexes, could have a maximum of 20,000 fields.

We updated the docs to clarify: https://firebase.google.com/docs/firestore/query-data/index-overview#index_limitations

like image 194
Juan Lara Avatar answered Dec 24 '25 01:12

Juan Lara



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!