I have a collection named
wokrspace_id (ObjectId) field on it. So whenever an item inserted/updated or deleted i want to use change stream watch method to broadcast it to users that belong to this workspace.
I have no difficulties dealing with insert/update operationTypes, i am able to access
fullDocument prop. But it turns out to be not that straightforward to access it on
i’ve encountered this SO issue, where @Asya_Kamsky mentioned in comments that it can be done by composing the documentKey, but unfortunately i could not accomplish this (would be grateful if there are any gists on that)
So, the question is how this can be done in most elegant way?