Documentation ¶
Index ¶
- func ChangeStreamClient(client *mongo.Client, coll *mongo.Collection)
- func ChangeStreamCollection(client *mongo.Client, coll *mongo.Collection)
- func ChangeStreamDB(client *mongo.Client, coll *mongo.Collection)
- func Count(coll *mongo.Collection, filter interface{}) (int64, error)
- func DeleteMany(coll *mongo.Collection, filter interface{}) (*mongo.DeleteResult, error)
- func DeleteOne(coll *mongo.Collection, filter interface{}) (*mongo.DeleteResult, error)
- func Distinct(coll *mongo.Collection, fieldName string, filter interface{}) ([]interface{}, error)
- func DownLoadGridFS(fileID interface{}, db *mongo.Database, bucketOptions *options.BucketOptions) (string, error)
- func Find(coll *mongo.Collection, filter interface{}) (*mongo.Cursor, error)
- func FindOne(coll *mongo.Collection, filter interface{}) *mongo.SingleResult
- func FindWithOption(coll *mongo.Collection, filter interface{}, findOptions *options.FindOptions) (*mongo.Cursor, error)
- func GetCOll(client *mongo.Client, dbName, collName string) *mongo.Collection
- func InsertMany(coll *mongo.Collection, data []interface{}) (*mongo.InsertManyResult, error)
- func InsertOne(ctx context.Context, coll *mongo.Collection, data interface{}) (*mongo.InsertOneResult, error)
- func NewClient(ctx context.Context, config *Config) *mongo.Client
- func NewClientWithTLS() (*mongo.Client, error)
- func UpdateByID(coll *mongo.Collection, id interface{}, data interface{}) (*mongo.UpdateResult, error)
- func UpdateByIDWithSession(client *mongo.Client, coll *mongo.Collection, id interface{}, data interface{}) error
- func UpdateMany(coll *mongo.Collection, filter interface{}, data interface{}) (*mongo.UpdateResult, error)
- func UpdateManyWithSession(client *mongo.Client, coll *mongo.Collection, filter interface{}, ...) error
- func UpdateOne(coll *mongo.Collection, filter interface{}, data interface{}) (*mongo.UpdateResult, error)
- func UpdateOneWithSession(client *mongo.Client, coll *mongo.Collection, filter interface{}, ...) error
- func UploadGridFS(filename string, data interface{}, db *mongo.Database, ...) error
- type ChangeStream
- type Client
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeStreamClient ¶
func ChangeStreamClient(client *mongo.Client, coll *mongo.Collection)
func ChangeStreamCollection ¶
func ChangeStreamCollection(client *mongo.Client, coll *mongo.Collection)
func ChangeStreamDB ¶
func ChangeStreamDB(client *mongo.Client, coll *mongo.Collection)
func DeleteMany ¶
func DeleteMany(coll *mongo.Collection, filter interface{}) (*mongo.DeleteResult, error)
func DeleteOne ¶
func DeleteOne(coll *mongo.Collection, filter interface{}) (*mongo.DeleteResult, error)
func Distinct ¶
func Distinct(coll *mongo.Collection, fieldName string, filter interface{}) ([]interface{}, error)
func DownLoadGridFS ¶
func DownLoadGridFS(fileID interface{}, db *mongo.Database, bucketOptions *options.BucketOptions) (string, error)
DownLoadGridFS ...
func FindOne ¶
func FindOne(coll *mongo.Collection, filter interface{}) *mongo.SingleResult
func FindWithOption ¶
func FindWithOption(coll *mongo.Collection, filter interface{}, findOptions *options.FindOptions) (*mongo.Cursor, error)
func InsertMany ¶
func InsertMany(coll *mongo.Collection, data []interface{}) (*mongo.InsertManyResult, error)
func InsertOne ¶
func InsertOne(ctx context.Context, coll *mongo.Collection, data interface{}) (*mongo.InsertOneResult, error)
func NewClientWithTLS ¶
func UpdateByID ¶
func UpdateByID(coll *mongo.Collection, id interface{}, data interface{}) (*mongo.UpdateResult, error)
func UpdateByIDWithSession ¶
func UpdateByIDWithSession(client *mongo.Client, coll *mongo.Collection, id interface{}, data interface{}) error
func UpdateMany ¶
func UpdateMany(coll *mongo.Collection, filter interface{}, data interface{}) (*mongo.UpdateResult, error)
func UpdateManyWithSession ¶
func UpdateManyWithSession(client *mongo.Client, coll *mongo.Collection, filter interface{}, data interface{}) error
func UpdateOne ¶
func UpdateOne(coll *mongo.Collection, filter interface{}, data interface{}) (*mongo.UpdateResult, error)
func UpdateOneWithSession ¶
func UpdateOneWithSession(client *mongo.Client, coll *mongo.Collection, filter interface{}, data interface{}) error
func UploadGridFS ¶
func UploadGridFS(filename string, data interface{}, db *mongo.Database, bucketOptions *options.BucketOptions) error
UploadGridFS ...
Types ¶
type ChangeStream ¶
type ChangeStream struct {
// contains filtered or unexported fields
}
ChangeStream defines what to watch? client, database or collection
func (*ChangeStream) SetCollection ¶
func (cs *ChangeStream) SetCollection(collection string)
SetCollection sets collection
func (*ChangeStream) SetDatabase ¶
func (cs *ChangeStream) SetDatabase(database string)
SetDatabase sets database
func (*ChangeStream) SetPipeline ¶
func (cs *ChangeStream) SetPipeline(pipeline []bson.D)
SetPipeline sets pipeline
func (*ChangeStream) Watch ¶
func (cs *ChangeStream) Watch(client *mongo.Client, cb callback)
Watch prints oplogs in JSON format
type Client ¶
type Client struct {
*bromel.BaseComponent
}
Click to show internal directories.
Click to hide internal directories.