The following are a few limitations to keep in mind concerning indexing:
- Index entries have to be less than 1,024 bytes. This is mostly an internal consideration, but we can keep it in mind if we run into issues with indexing.
- A collection can have up to 64 indexes.
- A compound index can have up to 31 fields.
- Special indexes cannot be combined in queries. This includes special query operators that have to use special indexes, such as $text for text indexes and $near for geospatial indexes. This is because MongoDB can use multiple indexes to fulfill a query, but not in all cases. There will be more about this issue in the Index intersection section.
- Multikey and geospatial indexes cannot cover a query. This means that ...