-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Sharding
-
None
-
Catalog and Routing
Currently in the config.shard.indexes and config.csrs.indexes we store one document per index, however, considering there won't be too many documents, and trying to make the operations easier to do, we should consider having just one document per collection, and having the indexes as a key-value pair having the index name as the key, that is, instead of:
{ _id: <uuid>_<indexName1>, indexName: <indexName1>, collectionUUID: <uuid>, keyPattern: <keyPattern1>, options: <options> }, { _id: <uuid>_<indexName2>, indexName: <indexName2>, keyPattern: <keyPattern2>, options: <options> }, ...
Having:
{ _id: <uuid>, <indexName1>: { indexName: <indexName1>, collectionUUID: <uuid>, keyPattern: <keyPattern1>, options: <options> }, <indexName2>: { indexName: <indexName2>, keyPattern: <keyPattern2>, options: <options> }, ... }
This would make other operations easier, like for example, the rename.