How can I insert a new field into a MongoDB collection using the C# Update
API?
What I am trying to do: I have a HomePhoneId
field that I need to insert into every document in my People
collection.
Any ideas?
Following code should work:
collection.Update(Query.Null, Update.Set("HomePhoneId", "some value"), UpdateFlags.Multi)
Btw, here is you can look into driver documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With