来自MongoDB文档Ifyouhaveacompoundindexonmultiplefields,youcanuseittoqueryonthebeginningsubsetoffields.Soifyouhaveanindexona,b,cyoucanuseitqueryon[a][a,b][a,b,c]假设我有包含这些字段的文档用户名姓名国家外场我的索引顺序是[UserID,Name,Country]所以如果我有这样的查询varq=(fromcincollection.AsQueryable()wherec.UserID==UserIDwhereName="test"where