Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
URI() string
Close(context.Context) error
Checker(context.Context, *healthcheck.CheckState) error
Connection() *mongodriver.MongoConnection
Collection(string) *mongodriver.Collection
}
type Mongo ¶
type Mongo struct {
mongodriver.MongoDriverConfig
// contains filtered or unexported fields
}
Mongo represents a simplistic MongoDB configuration.
func (*Mongo) Checker ¶
func (m *Mongo) Checker(ctx context.Context, state *healthcheck.CheckState) error
Checker is called by the healthcheck library to health the health state of this mongoDB instance
func (*Mongo) Collection ¶
func (m *Mongo) Collection(wellKnownName string) *mongodriver.Collection
func (*Mongo) Connection ¶
func (m *Mongo) Connection() *mongodriver.MongoConnection
type MongoCollection ¶
type MongoCollection interface {
Must() *mongodb.Must
Distinct(ctx context.Context, fieldName string, filter interface{}) ([]interface{}, error)
Count(ctx context.Context, filter interface{}, opts ...mongodb.FindOption) (int, error)
Find(ctx context.Context, filter interface{}, results interface{}, opts ...mongodb.FindOption) (int, error)
FindCursor(ctx context.Context, filter interface{}, opts ...mongodb.FindOption) (mongodb.Cursor, error)
FindOne(ctx context.Context, filter interface{}, result interface{}, opts ...mongodb.FindOption) error
Insert(ctx context.Context, document interface{}) (*mongodb.CollectionInsertResult, error)
InsertMany(ctx context.Context, documents []interface{}) (*mongodb.CollectionInsertManyResult, error)
Upsert(ctx context.Context, selector interface{}, update interface{}) (*mongodb.CollectionUpdateResult, error)
UpsertById(ctx context.Context, id interface{}, update interface{}) (*mongodb.CollectionUpdateResult, error)
UpdateById(ctx context.Context, id interface{}, update interface{}) (*mongodb.CollectionUpdateResult, error)
Update(ctx context.Context, selector interface{}, update interface{}) (*mongodb.CollectionUpdateResult, error)
UpdateMany(ctx context.Context, selector interface{}, update interface{}) (*mongodb.CollectionUpdateResult, error)
Delete(ctx context.Context, selector interface{}) (*mongodb.CollectionDeleteResult, error)
DeleteMany(ctx context.Context, selector interface{}) (*mongodb.CollectionDeleteResult, error)
DeleteById(ctx context.Context, id interface{}) (*mongodb.CollectionDeleteResult, error)
Aggregate(ctx context.Context, pipeline interface{}, results interface{}) error
NewLockClient() *lock.Client
}
type MongoCursor ¶ added in v1.2.0
Click to show internal directories.
Click to hide internal directories.