nrkno / sofie-core

Sofie Core: A Part of the Sofie TV Studio Automation System
https://github.com/nrkno/Sofie-TV-automation/
MIT License
124 stars 40 forks source link

Fix: various cases where only one document would be updated (SOFIE-3100) #1176

Closed nytamin closed 2 months ago

nytamin commented 2 months ago

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 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

Time Frame

I intend to merge this asap

Other Information

Status

jstarpl commented 2 months ago

We need to make sure this is merged upwards.