I couldn't figure out insert to a sub array...
- _id
- MyArray
- --Item
- ----ArrayItemId
- ----Name
I want to insert items to MyArray...
How my update document should be?
MyCollection.Update(
new QueryDocument { { "_id", MyObject.Id } },
new UpdateDocument { { "$set", new BsonDocument { { "MyArray",
new BsonArray { new BsonDocument {{ "ArrayItemId", myArrayField.Id }},
new BsonDocument {{ "Name", myArrayField.Name }} }}}}},
UpdateFlags.None);