Versions in this module Expand all Collapse all v3 v3.0.0 Jun 29, 2022 Changes in this version + const MongoConnPoolLimit + var ClientMap map[string]*MongoClient + var CommonClient *MongoClient + var IsInit bool + func Aggregate(result interface{}, dbName, collName string, pipeline interface{}, ...) error + func BulkWrite(dbName, collName string, models []mongo.WriteModel, ...) error + func Collection(projectId, collection string) *mongo.Collection + func Count(dbName, collName string, filter interface{}, opts ...*options.CountOptions) (int64, error) + func DB(projectId string, dbname string) *mongo.Database + func DecodeAll(cursor *mongo.Cursor, ctx context.Context, result interface{}) (err error) + func DeleteMany(dbName, collName string, filter interface{}, opts ...*options.DeleteOptions) error + func DeleteOne(dbName, collName string, filter interface{}, opts ...*options.DeleteOptions) error + func EnsureExpireIndex(db *mongo.Database, collection string, expireTime int32, keys ...string) + func EnsureIndex(db *mongo.Database, collection string, keys ...string) + func EnsureUniqIndex(db *mongo.Database, collection string, keys ...string) + func FindAll(result interface{}, dbName, collName string, query interface{}, ...) error + func FindOne(result interface{}, proj string, collName string, query interface{}, ...) error + func FindOneAndDelete(dbName, collName string, filter interface{}, ...) error + func FindOneAndUpdate(dbName, collName string, filter interface{}, update interface{}, ...) error + func GetCustomTLSConfig(caFile string) (*tls.Config, error) + func Init(adds map[string]string, prom bool) + func InsertMany(dbName, collName string, documents []interface{}, ...) (*mongo.InsertManyResult, error) + func InsertOne(dbName, collName string, document interface{}, ...) (interface{}, error) + func NewInt64(value int64) *int64 + func NewString(value string) *string + func NewTrue() *bool + func SetFindClient(Func GetClientFunc) + func UpdateAll(dbName, collName string, filter interface{}, update interface{}, ...) error + func UpdateOne(dbName, collName string, filter interface{}, update interface{}, ...) error + func UpsertOne(dbName, collName string, filter interface{}, update interface{}, ...) error + type GetClientFunc func(projectId string) (*MongoClient, error) + var GetClient GetClientFunc = func(projectId string) (client *MongoClient, err error) { ... } + type MongoClient struct + func NewClient(prom bool, opts ...*options.ClientOptions) (*MongoClient, error) + func NewDocumentClient(uri, CAFile string) (*MongoClient, error) + func NewDocumentClientWithProm(uri, CAFile string) (*MongoClient, error) + func NewMongoClient(uri string) (*MongoClient, error) + func NewMongoClientWithProm(uri string, prom bool) (*MongoClient, error) + func (c *MongoClient) Aggregate(result interface{}, dbName, collName string, pipeline interface{}, ...) (err error) + func (c *MongoClient) BulkWrite(dbName, collName string, models []mongo.WriteModel, ...) (err error) + func (c *MongoClient) Count(dbName, collName string, filter interface{}, opts ...*options.CountOptions) (count int64, err error) + func (c *MongoClient) Database(name string) *mongo.Database + func (c *MongoClient) DbColl(dbName, coll string) *mongo.Collection + func (c *MongoClient) DeleteMany(dbName, collName string, filter interface{}, opts ...*options.DeleteOptions) (err error) + func (c *MongoClient) DeleteOne(dbName, collName string, filter interface{}, opts ...*options.DeleteOptions) (err error) + func (c *MongoClient) FindAll(result interface{}, dbName, collName string, query interface{}, ...) (err error) + func (c *MongoClient) FindOne(result interface{}, dbName, collName string, query interface{}, ...) (err error) + func (c *MongoClient) FindOneAndDelete(dbName, collName string, filter interface{}, ...) (err error) + func (c *MongoClient) FindOneAndUpdate(dbName, collName string, filter interface{}, update interface{}, ...) (err error) + func (c *MongoClient) InsertMany(dbName, collName string, documents []interface{}, ...) (result *mongo.InsertManyResult, err error) + func (c *MongoClient) InsertOne(dbName, collName string, document interface{}, ...) (insertedID interface{}, err error) + func (c *MongoClient) UpdateAll(dbName, collName string, filter interface{}, update interface{}, ...) (err error) + func (c *MongoClient) UpdateOne(dbName, collName string, filter interface{}, update interface{}, ...) (err error) + func (c *MongoClient) UpsertOne(dbName, collName string, filter interface{}, update interface{}, ...) (err error) + type MyCursor struct + func NewMyCursor(c *mongo.Cursor) *MyCursor + func (mc *MyCursor) All(result interface{}) (err error) Other modules containing this package github.com/QuRuijie/zenDB