easymongo

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionCursor

type CollectionCursor struct {
	Context    context.Context
	Collection *mongo.Collection
}

func (*CollectionCursor) Count

func (cursor *CollectionCursor) Count(filter any) (int64, error)

func (*CollectionCursor) FindOne

func (cursor *CollectionCursor) FindOne(filter any, data any, opts ...*options.FindOneOptions) error

func (*CollectionCursor) Insert

func (cursor *CollectionCursor) Insert(data ...any) error

type MongoClient

type MongoClient struct {
	Client            *mongo.Client
	Context           context.Context
	Database          *mongo.Database
	LoadedCollections map[string]*CollectionCursor
}

func Connect

func Connect(options *options.ClientOptions, database string) (*MongoClient, error)

Constructor

func (*MongoClient) Collection

func (client *MongoClient) Collection(name string, opts ...*options.CollectionOptions) *CollectionCursor

Standard methods

func (*MongoClient) Disconnect

func (client *MongoClient) Disconnect() error

func (*MongoClient) UnloadCollection added in v1.3.0

func (client *MongoClient) UnloadCollection(name string) bool

Jump to

Keyboard shortcuts

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