Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PagingQuery ¶
type PagingQuery[T any] interface { // Find set the filter for query results. Find() (records []T, paginatedData *base.PaginatedData, err error) Aggregate(criteria ...interface{}) (records []T, paginatedData *base.PaginatedData, err error) // Select used to enable fields which should be retrieved. Select(selector interface{}) PagingQuery[T] Filter(selector interface{}) PagingQuery[T] Limit(limit int64) PagingQuery[T] Page(page int64) PagingQuery[T] Sort(sortField string, sortValue interface{}) PagingQuery[T] Context(ctx context.Context) PagingQuery[T] SetCollation(ctx *options.Collation) PagingQuery[T] }
PagingQuery is an interface that provides list of function you can perform on pagingQuery
func New ¶
func New[T any](collection *mongo.Collection) PagingQuery[T]
New is to construct PagingQuery object with mongo.Database and collection name
Click to show internal directories.
Click to hide internal directories.