mongop

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2023 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdSorter

type IdSorter struct {
	ID string `json:"_id"`
}

func (*IdSorter) MakeSortOptions

func (s *IdSorter) MakeSortOptions(filter bson.M, backward bool) (bson.M, error)

type MongoPaginator

type MongoPaginator struct {
	// contains filtered or unexported fields
}

func NewMongoPaginator

func NewMongoPaginator(store paginator.Store, opts *paginator.PaginationOptions) *MongoPaginator

func (*MongoPaginator) MakeSortOptions

func (p *MongoPaginator) MakeSortOptions(ctx context.Context, filter bson.M) (bson.M, error)

MakeSortOptions 生成ID分页查询选项,并将filter在原地更新

func (*MongoPaginator) StoreSorter

func (p *MongoPaginator) StoreSorter(ctx context.Context, first, last any) error

type MongoSorter

type MongoSorter interface {
	MakeSortOptions(filter bson.M, backward bool) (bson.M, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL