mongow

package module
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: MIT Imports: 9 Imported by: 1

README

mongow

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombineOperators added in v1.0.8

func CombineOperators(operators []Operator) interface{}

func ConvertObjectIdToStringValue added in v1.0.2

func ConvertObjectIdToStringValue(id interface{}) (string, error)

func IsNoDocumentsError added in v1.0.5

func IsNoDocumentsError(err error) bool

func NewBetweenFilter added in v1.0.5

func NewBetweenFilter(least, greatest interface{}) interface{}

func NewBooleanInFilter added in v1.0.5

func NewBooleanInFilter(value bool) interface{}

func NewIdFilter added in v1.0.5

func NewIdFilter(id interface{}) interface{}

func NewInFilter added in v1.0.5

func NewInFilter(items bsonx.Arr) interface{}

func NewIntInFilter added in v1.0.5

func NewIntInFilter(items []int) interface{}

func NewObjectIdFromString

func NewObjectIdFromString(id string) (primitive.ObjectID, error)

func NewRegexFilter added in v1.0.5

func NewRegexFilter(pattern string, options string) interface{}

func NewStringInFilter added in v1.0.5

func NewStringInFilter(items []string) interface{}

func NewStringObjectId added in v1.0.5

func NewStringObjectId() string

func NewTimeRangeBetweenFilter added in v1.0.5

func NewTimeRangeBetweenFilter(tr *timez.TimeRange) interface{}

Types

type MongoClient

type MongoClient interface {
	Disconnect(ctx context.Context)
	DB(name string) (MongoDB, error)
}

func NewClient

func NewClient(ctx context.Context, connStr string, timeout time.Duration) (MongoClient, error)

type MongoCollection added in v1.0.5

type MongoCollection struct {
	*mongo.Collection
}

type MongoDB

type MongoDB interface {
	Collection(name string) (*MongoCollection, error)
}

type Operator added in v1.0.8

type Operator map[string]interface{}

func NewSetOperator added in v1.0.5

func NewSetOperator(set interface{}) Operator

func NewUnsetOperator added in v1.0.7

func NewUnsetOperator(unset interface{}) Operator

Jump to

Keyboard shortcuts

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