I have a collection called "messages". Each message has a 'read' boolean value. In some instances when I retrieve the messages, I'd like to set the value to 'true', while returning the pre-modified value.
So, let's say I have 1 message, whose 'read' value is 'false'. When I retrieve it, I'd like to return the initial 'false' value, but in the same operation I'd like to set it to 'true'.
Any way of doing that?