【发布时间】:2018-03-10 14:59:34
【问题描述】:
我正在尝试从集合 A 中查找未从集合 B 中的任何文档中引用的所有文档。
我找到了this answer,但我无法将其翻译成 C#。
到目前为止,我已经尝试过:
from a in docA.AsQueryable()
join b in docB.AsQueryable() on a.Id equals b.DocARef into bs
from sub_b in bs.DefaultIfEmpty()
where sub_b == null
select new { a.Id, a.Name };
和
from a in docA.AsQueryable()
join b in docB.AsQueryable() on a.Id equals b.DocARef into bs
from sub_b in bs.DefaultIfEmpty()
where !bs.Any()
select new { a.Id, a.Name };
两者都导致NotSupportedException:$project or $group does not support {document}.
我做错了什么?
【问题讨论】:
标签: c# mongodb mongodb-.net-driver