Because the option { multi: true } was missing in some places when calling mongoCollection.update() .updateAsync() .upsert() .upsertAsync(), instead of updating all objects, only the first matching document is updated.
New Behavior
New types disallow calling an update method which might affect multiple documents without specifying the { multi: boolean } option.
All objects are now updated properly.
Affected areas
Nightly cleanup of orphaned PackageInfos only marked a single document for later removal
(unverified) When a PeripheralDevice goes offline, subdevices might not get their status set to offline
(unverified) When a ShowStylebase changes its blueprint or config preset, not all variant got their blueprintConfigPresetIdUnlinked set
(unverified) Migrations might not update all data correctly (so they might have to be run multiple times)
Time Frame
I intend to merge this asap
Other Information
Status
[x] PR is ready to be reviewed.
[x] The functionality has been tested by the author.
[ ] Relevant unit tests has been added / updated.
[ ] Relevant documentation (code comments, system documentation) has been added / updated.
…mullti: true } is required when calling update methods that can update multiple documents
About the Contributor
This pull request is posted on behalf of the NRK.
Type of Contribution
This is a: Bug fix
Current Behavior
Because the option
{ multi: true }
was missing in some places when callingmongoCollection.update() .updateAsync() .upsert() .upsertAsync()
, instead of updating all objects, only the first matching document is updated.New Behavior
New types disallow calling an update method which might affect multiple documents without specifying the
{ multi: boolean }
option. All objects are now updated properly.Affected areas
PackageInfos
only marked a single document for later removalTime Frame
I intend to merge this asap
Other Information
Status