Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertPaginationToMongoFilter ¶
func ConvertPaginationToMongoFilter(config *types.PaginationConfig) (bson.M, *options.FindOptions, error)
ConvertPaginationToMongoFilter converts a PaginationConfig into a MongoDB filter and FindOptions. It takes a PaginationConfig as input and returns a bson.M filter, *options.FindOptions, and an error. The filter is constructed based on the pagination parameters such as offset, limit, sort, search, and filters. The FindOptions are set based on the limit and skip values. The function supports various filter operators such as equal, not equal, greater than, greater than or equal to, less than, less than or equal to, in, not in, like, and not like. If an unsupported operator is encountered, an error is returned.
func ConvertPaginationToMongoPipeline ¶ added in v1.7.4
func ConvertPaginationToMongoPipeline(config *types.PaginationConfig) (bson.M, mongo.Pipeline, error)
ConvertPaginationToMongoPipeline converts a PaginationConfig into a MongoDB filter and pipeline. It takes a PaginationConfig as input and returns a bson.M filter, []bson.M pipeline, and an error.
Types ¶
This section is empty.