Each Team document contains a list of Player documents. Each Player contains a list of strings named PlayerColors.
The need is to update the PlayerColors of a specific Player within the specific team. So I thought I could make one filter for the parent (Team) level and combine that with a filter for the child (Player) level.
But I haven't seen any examples that mirror this approach, so perhaps this is not possible?
var filterTeam = Builders<Team>.Filter.Eq("TeamName", "GoldDigger");
var filterPlayer = Builders<Player>.Filter.Eq("PlayerName", "Greg");
// var combinedFilter = filterTeam & filterPlayer; // erroneous
List<string> newColors = new List<string>() { "peach", "periwinkle" };
UpdateDefinition<Player> updateDefinition = Builders<Player>.Update.Set(doc => doc.PlayerColors, newColors);
// collection.UpdateOne(combinedFilter, updateDefinition);
A copy of this project is here in GitHub.