-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.2.6
-
Component/s: mongorestore
-
None
Mongorestore version 3.2.6 seems to not preserve an order of fields in partialFilterExpression. This issue is reproducible and causing conflicting index configurations.
When dumped using mongodump(3.2.6) the users.metadata.json has correct order of indexes.
Example: users.metadata.json has following index configurations when dumped using mongodump
{ "v": 1, "unique": true, "key": { "region_id": 1, "zone_id": 1 }, "name": "region", "ns": "mydb.users", "background": true, "partialFilterExpression": { "dateCreated": { "$eq": null }, "bill_id": { "$exists": true } } }
But, when restored, the index region was restored as following:
{ "v": 1, "unique": true, "key": { "region_id": 1, "zone_id": 1 }, "name": "region", "ns": "mydb.users", "background": true, "partialFilterExpression": { "bill_id": { "$exists": true }, "dateCreated": { "$eq": null } } }
This leads to a conflicting index configuration when the index with the same name is created from application code.
Any help will be appreciated.
Thanks,
- is duplicated by
-
TOOLS-1506 Mongorestore does not preserve order of partial indexes. Conflicting index configurations
- Closed