Enhance pagination and repository functionality for MongoDB
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
- Updated the ListPaginationOptions struct to include SkipCount and IncludeCount fields, allowing for more flexible pagination behavior. - Modified the BuildListPagination function to handle cursor pagination with count options, improving performance by running count queries in parallel with data retrieval. - Enhanced the FindAll method in the repository to support concurrent counting of documents, reducing overall latency for list operations. - Added tests for pagination behavior, ensuring accurate handling of count scenarios in both offset and cursor pagination. This update improves the efficiency and flexibility of pagination in the MongoDB repository, enhancing the overall performance of list operations.
This commit is contained in:
@@ -64,6 +64,13 @@ func tenderSearchListProjection() bson.M {
|
||||
"modifications": 0,
|
||||
"source_file_url": 0,
|
||||
"source_file_name": 0,
|
||||
// Not used by list response mapping; can be large per tender.
|
||||
"translations": 0,
|
||||
"organizations": 0,
|
||||
"review_organization": 0,
|
||||
"processing_metadata.translated_data": 0,
|
||||
"processing_metadata.parsing_errors": 0,
|
||||
"processing_metadata.validation_errors": 0,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user