Hello Team,
Requirement is to identify transactions with the
{"Type": "Retail", "ArchivalStatus": {"$exists": false}, "CreatedDate": ISO Date }
and update a new field → {"ArchivalStatus": "COMPLETED"}
.
Below is the sample structure.
{"name" : "ABC", "details" : {...}, "ArchivalStatus": "COMPLETE", "CreatedDate": ISO Date() }
I’m planning to create the below partial index to pick only those records not having ArchivalStatus field.
db.coll.createIndex(
{ "Type": 1},
{ partialFilterExpression: { "ArchivalStatus": { $eq: null } } }
);
Below are the queries with respect to partial indexes in mongo version 4.4.
- why is the below index with
$exists : false
not supported ?
db.RV.createIndex(
{ "Type": 1},
{ partialFilterExpression: { "match_res.enrichmentstatus": { $exists: false } } }
);
-
Please help me understand the pre requisite to create partial indexes with ‘$and’ operator at the top-level only (https://www.mongodb.com/docs/v5.0/core/index-partial/) with an example.
-
How to create partial index with multiple fields in mongo version 4.4
Regards,
Laks