Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mongo C# strongly typed index on nested array property

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

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

GamePlay has an IEnumerable<PartyInGame>, where PartyInGame has a public string Username { get; set; }

like image 325
Etchelon Avatar asked Nov 09 '22 04:11

Etchelon


1 Answers

Just a heads up but for now Robert Stam has said you cannot do this at present but they are planning it for a future release you can track it here... CSHARP-1955

like image 101
Buvy Avatar answered Nov 14 '22 22:11

Buvy