utilMongodb

package
v0.0.0-...-f25d982 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MongodbHasIndexes

func MongodbHasIndexes(indexView mongo.IndexView) (found bool)

Types

type MongodbClient

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

func NewMongodbClient

func NewMongodbClient(conf *MongodbClientConf) (client *MongodbClient, err error)

func (*MongodbClient) CollectionAggregate

func (mc *MongodbClient) CollectionAggregate(collectionName string, group bson.D, filter interface{}, sort interface{}, results interface{}) error

func (*MongodbClient) CollectionCreateIndexes

func (mc *MongodbClient) CollectionCreateIndexes(collectionName string, indexModels []mongo.IndexModel) (err error)

func (*MongodbClient) CollectionDelete

func (mc *MongodbClient) CollectionDelete(collectionName string, filter interface{}) (count int64, err error)

func (*MongodbClient) CollectionFind

func (mc *MongodbClient) CollectionFind(collectionName string, filter interface{}, sort interface{}, result interface{}) (err error)

func (*MongodbClient) CollectionInsertMany

func (mc *MongodbClient) CollectionInsertMany(collectionName string, data []interface{}) (ids []string, err error)

func (*MongodbClient) CollectionInsertOne

func (mc *MongodbClient) CollectionInsertOne(collectionName string, data interface{}) (id string, err error)

func (*MongodbClient) CollectionSelect

func (mc *MongodbClient) CollectionSelect(collectionName string, filter interface{}, sort interface{}, limit int64, offset int64, results interface{}, total *int64) (err error)

func (*MongodbClient) CollectionUpdate

func (mc *MongodbClient) CollectionUpdate(collectionName string, filter interface{}, update interface{}) (count int64, err error)

func (*MongodbClient) New

func (mc *MongodbClient) New() (client *MongodbClient, err error)

type MongodbClientConf

type MongodbClientConf struct {
	Host          string
	DbName        string
	User          string
	Password      string
	LoggerOptions *options.LoggerOptions
}

Jump to

Keyboard shortcuts

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