Documentation ¶
Index ¶
- Variables
- type MongoDB
- func (m *MongoDB) Aggregate(ctx context.Context, result interface{}, opts ...*options.AggregateOptions) error
- func (m *MongoDB) AggregateByPage(ctx context.Context, countResult, result interface{}, ...) error
- func (m *MongoDB) CountDocuments(ctx context.Context) (int64, error)
- func (m *MongoDB) DeleteById(ctx context.Context, id interface{}) error
- func (m *MongoDB) DeleteMany(ctx context.Context) (int64, error)
- func (m *MongoDB) DeleteOne(ctx context.Context) (int64, error)
- func (m *MongoDB) EstimatedDocumentCount(ctx context.Context) (int64, error)
- func (m *MongoDB) Find(ctx context.Context, result interface{}, sortFields ...string) error
- func (m *MongoDB) FindByPage(ctx context.Context, paging *Paging, result interface{}, sortFields ...string) (err error)
- func (m *MongoDB) FindOne(ctx context.Context, result interface{}, sortFields ...string) error
- func (m *MongoDB) InsertMany(ctx context.Context, documents []interface{}) ([]interface{}, error)
- func (m *MongoDB) InsertOne(ctx context.Context, document interface{}) (interface{}, error)
- func (m *MongoDB) UpdateById(ctx context.Context, id, update interface{}, opts ...*options.UpdateOptions) error
- func (m *MongoDB) UpdateMany(ctx context.Context, update interface{}, opts ...*options.UpdateOptions) error
- func (m *MongoDB) UpdateOne(ctx context.Context, update interface{}, opts ...*options.UpdateOptions) error
- type Paging
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultDatabase string
)
Functions ¶
This section is empty.
Types ¶
type MongoDB ¶
type MongoDB struct { Database string Collection string Filter map[string]interface{} CountPipeline []bson.M // AggregateByPage Pipeline []bson.M // Aggregate/AggregateByPage }
func (*MongoDB) AggregateByPage ¶
func (*MongoDB) CountDocuments ¶
func (*MongoDB) DeleteById ¶
func (*MongoDB) EstimatedDocumentCount ¶
func (*MongoDB) FindByPage ¶
func (*MongoDB) InsertMany ¶
func (*MongoDB) UpdateById ¶
func (*MongoDB) UpdateMany ¶
Click to show internal directories.
Click to hide internal directories.