mongox

package
v0.0.0-...-9bd63dd Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(url string, opts *options.ClientOptions) *mongo.Client

Types

type MongoCollection

type MongoCollection interface {
	GetCollection() *mongo.Collection

	InsertOne(document interface{}) (*mongo.InsertOneResult, error)
	InsertMany(documents []interface{}) (*mongo.InsertManyResult, error)

	DeleteOne(filter interface{}) error
	DeleteMany(filter interface{}) error

	UpdateOne(filter, update interface{}) error
	UpdateMany(filter, update interface{}) error

	FindOne(filter interface{}) *mongo.SingleResult
	FindMany(filter interface{}, options *options.FindOptions) (*mongo.Cursor, error)

	Count() (int64, error)
}

func New

func New(client *mongo.Client, database, collection string) MongoCollection

Jump to

Keyboard shortcuts

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