Documentation ¶
Index ¶
- Constants
- Variables
- func All(name string, value ...any) *field
- func And(expr ...Expr) *logical
- func DecodeAll[T any](ctx context.Context, cur *mongo.Cursor) (docs []T, err error)
- func DecodeOne[T any](r *mongo.SingleResult) (doc T, err error)
- func ElemMatch(name string, query ...Expr) *field
- func Eq(name string, value any) *field
- func ErrorStreamServerInterceptor() grpc.StreamServerInterceptor
- func ErrorUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func Exists(name string, value bool) *field
- func FindOptions(index uint64, size uint32) *options.FindOptions
- func GetClient(ctx context.Context, uri string, log zerolog.Logger) *mongo.Client
- func GetDB(ctx context.Context, uri string, log zerolog.Logger) *mongo.Database
- func GetDBName(uri string) (string, error)
- func Gt(name string, value any) *field
- func Gte(name string, value any) *field
- func In(name string, value ...any) *field
- func Lt(name string, value any) *field
- func Lte(name string, value any) *field
- func Ne(name string, value any) *field
- func Nin(name string, value ...any) *field
- func Nor(expr ...Expr) *logical
- func Not(name string, expr Expr) *field
- func Or(expr ...Expr) *logical
- func Regex(name string, pattern string, opts ...string) *field
- func Size(name string, value uint) *field
- func ToBson(doc any) (bson.M, error)
- type Expr
- type Filter
Constants ¶
View Source
const ( ErrMsgDecode = "failed to decode document due to error: %w" ErrMsgQuery = "failed to execute query due to error: %w" ErrMsgMarshal = "failed to marshal document due to error: %w" ErrMsgUnmarshal = "failed to unmarshal document due to error: %w" )
View Source
const ErrMsgClient = "failed to create mongodb client"
View Source
const ErrMsgDatabase = "failed to create mongodb database"
Variables ¶
View Source
var ErrNoDB = errors.New("database name not found in URI")
Functions ¶
func ErrorStreamServerInterceptor ¶
func ErrorStreamServerInterceptor() grpc.StreamServerInterceptor
func ErrorUnaryServerInterceptor ¶
func ErrorUnaryServerInterceptor() grpc.UnaryServerInterceptor
func FindOptions ¶
func FindOptions(index uint64, size uint32) *options.FindOptions
Types ¶
Click to show internal directories.
Click to hide internal directories.