collection

package
v0.0.0-...-2bbbdf5 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountOperation

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

func Count

func Count(c *mongo.Collection, opts ...CountOption) CountOperation

func (CountOperation) Count

func (x CountOperation) Count(ctx context.Context) (int64, error)

type CountOption

type CountOption func(x *CountOperation)

func WithCountApproximation

func WithCountApproximation() CountOption

func WithCountFilter

func WithCountFilter(filter bsoncore.Document) CountOption

func WithCountOptions

func WithCountOptions(opt *options.CountOptions) CountOption

type DeleteOperation

type DeleteOperation[T any] struct {
	// contains filtered or unexported fields
}

func Delete

func Delete[T any](c *mongo.Collection, opts ...DeleteOption[T]) DeleteOperation[T]

func (DeleteOperation[T]) Delete

func (x DeleteOperation[T]) Delete(ctx context.Context) error

type DeleteOption

type DeleteOption[T any] func(x *DeleteOperation[T])

func WithDeleteFilter

func WithDeleteFilter[T any](filter bsoncore.Document) DeleteOption[T]

func WithDeleteOptions

func WithDeleteOptions[T any](opt *options.DeleteOptions) DeleteOption[T]

type FindManyOperation

type FindManyOperation[T any] struct {
	// contains filtered or unexported fields
}

func FindMany

func FindMany[T any](c *mongo.Collection, opts ...FindManyOption[T]) FindManyOperation[T]

func (FindManyOperation[T]) FindMany

func (x FindManyOperation[T]) FindMany(ctx context.Context) ([]T, error)

type FindManyOption

type FindManyOption[T any] func(x *FindManyOperation[T])

func WithFindManyFilter

func WithFindManyFilter[T any](filter bsoncore.Document) FindManyOption[T]

func WithFindManyOptions

func WithFindManyOptions[T any](opt *options.FindOptions) FindManyOption[T]

type FindOperation

type FindOperation[T any] struct {
	// contains filtered or unexported fields
}

func Find

func Find[T any](c *mongo.Collection, opts ...FindOption[T]) FindOperation[T]

func (FindOperation[T]) Find

func (x FindOperation[T]) Find(ctx context.Context) (T, error)

type FindOption

type FindOption[T any] func(x *FindOperation[T])

func WithFindFilter

func WithFindFilter[T any](filter bsoncore.Document) FindOption[T]

func WithFindOptions

func WithFindOptions[T any](opt *options.FindOneOptions) FindOption[T]

type InsertOperation

type InsertOperation[T any] struct {
	// contains filtered or unexported fields
}

func Insert

func Insert[T any](c *mongo.Collection, opts ...InsertOption[T]) InsertOperation[T]

func (InsertOperation[T]) Insert

func (x InsertOperation[T]) Insert(ctx context.Context, document T) error

type InsertOption

type InsertOption[T any] func(x *InsertOperation[T])

func WithInsertOptions

func WithInsertOptions[T any](opt *options.InsertOneOptions) InsertOption[T]

type ReplaceOperation

type ReplaceOperation[T any] struct {
	// contains filtered or unexported fields
}

func Replace

func Replace[T any](c *mongo.Collection, opts ...ReplaceOption[T]) ReplaceOperation[T]

func (ReplaceOperation[T]) Replace

func (x ReplaceOperation[T]) Replace(ctx context.Context, document T) error

type ReplaceOption

type ReplaceOption[T any] func(x *ReplaceOperation[T])

func WithReplaceFilter

func WithReplaceFilter[T any](filter bsoncore.Document) ReplaceOption[T]

func WithReplaceOptions

func WithReplaceOptions[T any](opt *options.ReplaceOptions) ReplaceOption[T]

Jump to

Keyboard shortcuts

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