我正在使用 MongoDb C# 驱动程序,并且我有下面显示的集合。我想在 LINQ 查询中按 Rating.Count 排序,但我收到了同样的错误:
无法确定表达式的序列化信息:a.Rating.Count。
Mongo C# 驱动程序不支持集合计数吗?
activities => activities.OrderByDescending(a => a.Rating.Count)
{
"_id" : "5171243a3814fe1fb0bfbad6",
"Verb" : "post",
"Url" : null,
"Title" : "posted a new question",
"Content" : "mongodb and redis",
"Icon" : null,
"Tags" : ["mongodb", "redis"],
"Rating" : [{
"UserId" : "516be7913814fe2b0cc123c4",
"Value" : 1
}]
}
提前致谢!!!