嵌套数组属性上的Mongo C#强类型索引

嵌套数组属性上的Mongo C#强类型索引,c#,mongodb,indexing,mongodb-.net-driver,C#,Mongodb,Indexing,Mongodb .net Driver,使用MongoDB C#Driver 2.3,以下代码的强类型版本是什么 database.GetCollection<GamePlay>() .Indexes .CreateOne("{ \"PartiesInGame.Username\": 1 }"); database.GetCollection() .索引 .CreateOne(“{\”PartiesInGame.Username\”:1}”); GamePlay有一个IEnumerable,其中Part

使用MongoDB C#Driver 2.3,以下代码的强类型版本是什么

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

GamePlay
有一个
IEnumerable
,其中
PartyInGame
有一个
public string Username{get;set;}

只是提醒一下,但是现在罗伯特·斯塔姆说你现在不能这么做,但他们正在计划将来的发布,你可以在这里跟踪它