-
Type: Task
-
Resolution: Works as Designed
-
Priority: Trivial - P5
-
None
-
Affects Version/s: None
-
Component/s: None
I'm trying to run this command:
var applicationsPipeline = PipelineDefinition<AffiliateRecord, List<ApplicationRecord>>.Create(new IPipelineStageDefinition[] { PipelineStageDefinitionBuilder.Match<AffiliateRecord>(filter), PipelineStageDefinitionBuilder.Unwind<AffiliateRecord, AffiliateRecord>("Applications"), PipelineStageDefinitionBuilder.Match<AffiliateRecord>(matchApplications), PipelineStageDefinitionBuilder.ReplaceRoot<AffiliateRecord, List<ApplicationRecord>>(x => x.Applications), PipelineStageDefinitionBuilder.Skip<List<ApplicationRecord>>(offset), PipelineStageDefinitionBuilder.Limit<List<ApplicationRecord>>(limit), }); var applicationsFacet = AggregateFacet.Create("applications", applicationsPipeline); var aggregate = collection .Aggregate() .Facet(applicationsFacet, ...); var facetResult = await aggregate.SingleOrDefaultAsync();
but I'm getting this error:
System.FormatException: Cannot deserialize a 'List<ApplicationRecord>' from BsonType 'Document'.
What am I missing?