Mongo C # strongly typed index for nested array property

Using MongoDB C # Driver 2.3, what is a strongly typed version of the following code?

database.GetCollection<GamePlay>()
    .Indexes
    .CreateOne("{ \"PartiesInGame.Username\": 1 }");

GamePlayhas IEnumerable<PartyInGame>where PartyInGamehaspublic string Username { get; set; }

+4
source share
1 answer

Just heads-up, but so far Robert Stam said you can't do it now, but they are planning it for a future release, you can track it here ... CSHARP-1955

+1
source

Source: https://habr.com/ru/post/1663568/


All Articles