mongodb

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongodbConnection added in v0.2.4

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

func NewMongoConnection

func NewMongoConnection(ctx context.Context, url string) (*MongodbConnection, error)

func (*MongodbConnection) Close added in v0.2.4

func (c *MongodbConnection) Close(handler func(err error))

type MongodbOperator added in v0.3.0

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

func NewMongoOperator added in v0.3.0

func NewMongoOperator[T any](connection *MongodbConnection) *MongodbOperator[T]

func (*MongodbOperator[T]) Create added in v0.3.0

func (c *MongodbOperator[T]) Create(
	ctx context.Context,
	collection *clerk.Collection,
	data T,
) error

func (*MongodbOperator[T]) Delete added in v0.3.0

func (c *MongodbOperator[T]) Delete(
	ctx context.Context,
	collection *clerk.Collection,
	filter map[string]any,
) error

func (*MongodbOperator[T]) Query added in v0.3.0

func (c *MongodbOperator[T]) Query(
	ctx context.Context,
	collection *clerk.Collection,
	filter map[string]any,
	skip int,
	take int,
) (<-chan T, error)

func (*MongodbOperator[T]) Update added in v0.3.0

func (c *MongodbOperator[T]) Update(
	ctx context.Context,
	collection *clerk.Collection,
	filter map[string]any,
	data T,
	upsert bool,
) error

func (*MongodbOperator[T]) Watch added in v0.3.0

func (c *MongodbOperator[T]) Watch(
	ctx context.Context,
	collection *clerk.Collection,
	operation clerk.Operation,
) (<-chan T, error)

Jump to

Keyboard shortcuts

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