Using the MongoDB C# Driver version 2.0.1 with Mongodb 3.0, is it possible to use typed methods to update an array field document element?
For example, I have the following document:
{
Name:"Ken",
ContactNo:[ { Number:"123", Type:"Mobile"},
{ Number:"456", Type:"Office"},
{ Number:"531", Type:"Fax"}
]
}
How do I do the following operations using typed C# methods:
1) Update the Type
field for all elements of the ContactNo
array to be "PABX
"
2) Update ContactNo
array document element's Type
field whose Number
field equals "123
" to be "Fiber
"
3) Update the first element of the Contact
array and set its Type
field to be "Unknown
"