I'd like to know the best way to update a nested object if the mongodb source collection has changed. I'm using the MongoDb .Net driver. Here is a short example:
Events collection:
[{
_id: "59ad4e1f7a25f428bc6aeac7",
EventName: "Event Foo",
StartDate: "2017-08-31 09:00:00.000Z",
Games: [
{ _id: "39ad4e1j7a26f42835gafac8", GameName: "Foo Game" },
{ _id: "19ad4e1f7a25f42835gaeac7", GameName: "Bar Game" }
],
Language: { "59a6612f48ecdd4c8eaf1b09", "English" }
}]
Games collection
[
{ _id: "39ad4e1j7a26f42835gafac8", GameName: "Foo Game" },
{ _id: "19ad4e1f7a25f42835gaeac7", GameName: "Bar Game" },
{ _id: "59a80d677a25f412ecda1b2d", GameName: "Foo-Bar Game" }
]
Now I have daily job that keeps my Games collection up to date.
Question: How can I keep my Events nested objects up to date id my Games collection changes ?