Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrExpectedStruct = constError("struct type object expected") ErrNoIdField = constError("given object does not have an ID field") ErrInvalidOrderBy = constError("given order by document is invalid") )
errors
Variables ¶
This section is empty.
Functions ¶
func WithMongoIdField ¶
WithMongoIdField sets a custom mongodb id field (default: _id).
func WithStructIdField ¶
WithStructIdField sets a custom id field (default: Id).
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is a small helper for pagination related to mongodb.
func NewBuilder ¶
NewBuilder is a factory method for creating a new builder.
func (*Builder) NextFilter ¶
NextFilter determines the filter to query the next document after the one given as obj. It takes the given filter and orderBy bson documents into consideration. The resulting filter will get returned as a bson document.
Click to show internal directories.
Click to hide internal directories.