I have the following document representing a chat room, where the timestamp in the member objects represents that particular user's last activity in the room.
{
"id": "4ff130cc-3201-4a30-8a4c-5ce4303d28d0",
"name": "General chat",
"members": [
{
"timestamp": 1437074682224 ,
"user_id": "bdb4c00c-0ce8-4e22-9331-38b5c4b083e4"
},
{
"timestamp": 1437074693805 ,
"user_id": "7708ebc6-915b-4bfd-b63e-849bacefa201"
}
]
}
When the user e.g. joins the room, I would like to update the timestamp. It seems like a trivial operation, but I cannot get it to work.
I am using the official JavaScript driver. How do I update the timestamp with a given user_id?