Mongo离开外部联接问题

时间:2019-03-27 11:10:06

标签: mongodb join

我遇到错误

  

System.NotSupportedException:'$ project或$ group不支持{document}。'

同时对mongo集合进行左外部联接。

            var temp = (from invoice in GetCollectionAsQueryable<Invoice>("Invoice")
                    join lab in GetCollectionAsQueryable<Client>("Client")
                    on invoice.LabelerCode equals lab.LabelerCode
                    join not in GetCollectionAsQueryable<Notification>("Notification")
                    on lab._id equals not.ClientId into notifyOuterJoin
                    from res1 in notifyOuterJoin.DefaultIfEmpty()
                    where lab.IsBankrupt == false && invoice.InvoiceQuarter == 20181
                    select new Labeler
                    {
                        IsBankrupt = lab.IsBankrupt,
                        RetryAttempt = res1 != null ? res1.RetryAttempt : 0
                    }).ToList();

纠正我在这里做错了什么吗?以及如何获取翻译后的mongo表达查询?

0 个答案:

没有答案