mongo

package
v0.0.0-...-a542072 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	NoUse int64 = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func (*Collection) Aggregate

func (c *Collection) Aggregate(ctx context.Context, pipeline interface{}, results interface{}) error

func (*Collection) Count

func (c *Collection) Count(ctx context.Context) (int64, error)

func (*Collection) DeleteMany

func (c *Collection) DeleteMany(ctx context.Context) error

func (*Collection) DeleteOne

func (c *Collection) DeleteOne(ctx context.Context) error

func (*Collection) Find

func (c *Collection) Find(ctx context.Context, results interface{}) error

func (*Collection) FindOne

func (c *Collection) FindOne(ctx context.Context, result interface{}) error

func (*Collection) FindOneOrZero

func (c *Collection) FindOneOrZero(ctx context.Context, result interface{}) error

func (*Collection) InsertMany

func (c *Collection) InsertMany(ctx context.Context, documents []interface{}) error

func (*Collection) InsertOne

func (c *Collection) InsertOne(ctx context.Context, document interface{}) (primitive.ObjectID, error)

func (*Collection) Limit

func (c *Collection) Limit(limit int64) *Collection

func (*Collection) Skip

func (c *Collection) Skip(skip int64) *Collection

func (*Collection) Sort

func (c *Collection) Sort(sorts ...S) *Collection

func (*Collection) UpdateMany

func (c *Collection) UpdateMany(ctx context.Context, update interface{}) error

func (*Collection) UpdateOne

func (c *Collection) UpdateOne(ctx context.Context, update interface{}) error

func (*Collection) Upsert

func (c *Collection) Upsert(ctx context.Context, update interface{}) error

func (*Collection) Where

func (c *Collection) Where(filters ...F) *Collection

func (*Collection) WhereAnd

func (c *Collection) WhereAnd(filter F) *Collection

func (*Collection) WhereOr

func (c *Collection) WhereOr(filter F) *Collection

type Database

type Database struct {
	*mongo.Database
}

func NewDatabase

func NewDatabase(ctx context.Context, uri string, name string) (*Database, error)

func (*Database) Close

func (db *Database) Close(ctx context.Context) error

func (*Database) Collection

func (db *Database) Collection(name string) *Collection

type F

type F bson.D

func (F) And

func (f F) And(filter F) F

func (F) Or

func (f F) Or(filter F) F

type K

type K string
const Key_ID K = "_id"

func Key

func Key(k string) K

func (K) Asc

func (k K) Asc() S

func (K) Desc

func (k K) Desc() S

func (K) Eq

func (k K) Eq(value interface{}) F

func (K) Exists

func (k K) Exists(value bool) F

func (K) Gt

func (k K) Gt(value interface{}) F

func (K) Gte

func (k K) Gte(value interface{}) F

func (K) In

func (k K) In(value interface{}) F

func (K) Lt

func (k K) Lt(value interface{}) F

func (K) Lte

func (k K) Lte(value interface{}) F

func (K) Ne

func (k K) Ne(value interface{}) F

func (K) Nin

func (k K) Nin(value interface{}) F

func (K) Proj

func (k K) Proj() Proj

func (K) Regex

func (k K) Regex(value string) F

func (K) Set

func (k K) Set(v interface{}) U

type Proj

type Proj bson.D

type S

type S bson.D

type U

type U bson.M

func Update

func Update() U

func (U) Set

func (u U) Set(key K, value interface{}) U

Jump to

Keyboard shortcuts

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