I have a collection of messages:
{
messageid: ObjectId
userid: ObjectId
message: string
isread: true|false
}
and a collecti
You could do this with trigger in sql. But in mongo, there is no trigger.
You can perform operation on one of the document and check for LastErrorMessage on that operation by setting SafeMode.True
Then if no error then update the second collection.
Currently there is no way to do this in atomic way.
If there is, I would have used in my project. I needed that functionality too.