I\'ve run the following code in mongo shell:
db.unicorns.insert({name: \'Dunx\', loves: [\'grape\', \'watermelon\']});
and now I\'ve so
To do this with the updated syntax and regular BsonDocument
s instead of defined objects, use the following:
var filter = Builders.Filter.Eq("name": "Aurora");
var update = Builders.Update.Push("loves", "sugar"):
// you can also use the async update method from Alex's answer here
var result = fantasyContext.Unicorns.UpdateOne(filter, update);