I can't seem to figure out the exact set of statements that are needed to update an entire element of an array. This is what I have currently:
//id, gameId, updatedGame passed in
var client = mongoContext.Clients.FindOne( Query<Client>.EQ(x => x.Id, id));
var index = client.Games.FindIndex(x => x.Id == gamedId);
var update = Update<Client>.Set(x => x.Games[index], updatedGame);
var query = Query<Client>.EQ(x => x.Id, client.Id);
mongoContext.Clients.Update(query, update);
mongoContext.Clients.Save(client);
I can do this in javascript, but unfortunately I'm working in C# at the moment. Thanks for any help.