skip to Main Content

Json – MongoDB Sorting Not Working as Expected in C# with Aggregate Lookup

I'm trying to sort a list in MongoDB using C# with the following method: public async Task<SearchResponseDTO<CampaignValidateDTO>> Search(SearchRequestDTO<CampaignValidateSearchFilterDTO> searchRequestDTO, string tenantId) { var filterDefinition = GetSearchFilter(searchRequestDTO, tenantId); var totalItems = await mongoCollection.CountDocumentsAsync(filterDefinition); var itemsWithLookup = await mongoCollection.Aggregate() .Match(filterDefinition) .As<CampaignValidateDTO>() .Lookup<CampaignValidateDTO,…

VIEW QUESTION
Back To Top
Search