Hello, I have created a document, in Mongodb compass it looks like:
{
meeting_name: "it is a test meeting name"
to: Array
0: Object
contact: Object
phone:"+33123456789"
1: Object
contact: Object
phone:"+33987654321"
}
The field “to” is an array of object contact, where the object contact is a map, with key value pares like “phone”: “+33123456789”. I want to do something like: find the contact with phone “+33123456789”, set the name of the contact to be “john doe”, so that the data looks like:
{
meeting_name: "it is a test meeting name"
to: Array
0: Object
contact: Object
phone:"+33123456789"
name: "john doe"
1: Object
contact: Object
phone:"+33987654321"
}
how can I implement this function by golang driver?