When a Materialized View triggers a deleteDocument, the accumulators are updated correctly but not the "_id".
Reproduction:
With collection: [{country: 'France'}]
Create a MV with a groupBy on country: the view contains an 'France' entry.
Trigger addDocument on the mv: mv.addDocument({country: 'Switzerland'}).
The MV contains: [{country: 'France'}, {country: 'Switzerland'}]
Trigger deleteDocument: mv.deleteDocument({country: 'Switzerland'})
⚠️ The MV still contains: [{country: 'France'}, {country: 'Switzerland'}] instead of [{country: 'France'}].
When a Materialized View triggers a deleteDocument, the accumulators are updated correctly but not the "_id".
Reproduction:
With collection:
[{country: 'France'}]Create a MV with a groupBy on country: the view contains an 'France' entry.
⚠️ The MV still contains:
Trigger
addDocumenton the mv:mv.addDocument({country: 'Switzerland'}).The MV contains:
[{country: 'France'}, {country: 'Switzerland'}]Trigger deleteDocument:
mv.deleteDocument({country: 'Switzerland'})[{country: 'France'}, {country: 'Switzerland'}]instead of[{country: 'France'}].