在聚合框架 C# 中使用带有 Multiple Facet、Unwind 和 sort

我如何在 C# 中表示这个管道?


-----Id

-----Name

-----ProductAttributes  (object array)

     |

     -----ProductAttributeType  

     -----ProductAttributeValues  (string array)

我的收藏:


{ "_id" : ObjectId("5b41a5e225cd892c14628b78"), "Name" : "Esmalte Super Pérola Fashion Glamour", "ProductAttributes" : [ { "ProductAttributeType" : "Coleção", "Values" : [ "Fashion" ] }, { "ProductAttributeType" : "Tamanho", "Values" : [ "8 ml" ] }, { "ProductAttributeType" : "Tom", "Values" : [ "Vermelho", "Cremoso" ] } ] }

{ "_id" : ObjectId("5b41a5e225cd892c14628b79"), "Name" : "Esmalte Fina Flor Azul 97", "ProductAttributes" : [ { "ProductAttributeType" : "Tamanho", "Values" : [ "8 ml" ] }, { "ProductAttributeType" : "Tom", "Values" : [ "Azul", "Cremoso" ] } ] }

{ "_id" : ObjectId("5b41a5e225cd892c14628b7a"), "Name" : "Esmalte Fina Flor Matte Cashmere", "ProductAttributes" : [ { "ProductAttributeType" : "Coleção", "Values" : [ "Matte" ] }, { "ProductAttributeType" : "Tamanho", "Values" : [ "8 ml" ] }, { "ProductAttributeType" : "Tom", "Values" : [ "Verde", "Matte", "Fosco" ] } ] }

{ "_id" : ObjectId("5b41a5e325cd892c14628b7b"), "Name" : "Esmalte Fina Flor Dany", "ProductAttributes" : [ { "ProductAttributeType" : "Tamanho", "Values" : [ "8 ml" ] }, { "ProductAttributeType" : "Tom", "Values" : [ "Azul" ] } ] }

{ "_id" : ObjectId("5b41a5e325cd892c14628b7c"), "Name" : "Esmalte Fina Flor Londres", "ProductAttributes" : [ { "ProductAttributeType" : "Tamanho", "Values" : [ "8 ml" ] }, { "ProductAttributeType" : "Tom", "Values" : [ "Chumbo", "Perolado", "Cintilante" ] } ] }


我正在尝试此代码但没有成功。而且我不知道如何在管道中添加两个方面。


错误行 .Facet(facetPipelineTom);


错误 CS0411 无法从用法推断方法“IAggregateFluent.Facet(IEnumerable>, AggregateFacetOptions)”的类型参数。尝试明确指定类型参数。


汪汪一只猫
浏览 208回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP