I have the MongoDb Document describe in the following playground
https://mongoplayground.net/p/7unPX_abybK
I desperately try to add an element in the links of a targetedEvent when the name of the targetedEvent is "RdvPris" and that it has no link whith targetType:"missions"
So for the playground example , it should add an element under
"targetType": "t4"
and "targetType": "t5"
please help it is a real puzzle for me
Has anyone a solution ?
Thanx by advance
2
Answers
In the MongoDB shell, add a link to the "RdvPris" event’s "links" array if no link with targetType: "missions" exists.
To add an element in the "links" array of a "targetedEvent" when the name of the "targetedEvent" is "RdvPris" and it has no link with "targetType" set to "missions", you can use this mongo query, it will update all matching document in collection.
Here is the playground link with example.
Feel free to add _id field accordingly.