Documentation
¶
Index ¶
- type Mongo
- func (m *Mongo) Aggregate(ctx context.Context, project, col string, req *model.AggregateRequest) (interface{}, error)
- func (m *Mongo) Batch(ctx context.Context, project string, txRequest *model.BatchRequest) error
- func (m *Mongo) Close() error
- func (m *Mongo) Create(ctx context.Context, project, col string, req *model.CreateRequest) error
- func (m *Mongo) Delete(ctx context.Context, project, col string, req *model.DeleteRequest) error
- func (m *Mongo) DescribeTable(ctx context.Context, project, dbType, col string) ([]utils.FieldType, []utils.ForeignKeysType, error)
- func (m *Mongo) GetCollections(ctx context.Context, project string) ([]utils.DatabaseCollections, error)
- func (m *Mongo) GetDBType() utils.DBType
- func (m *Mongo) IsClientSafe() error
- func (m *Mongo) RawBatch(ctx context.Context, queries []string) error
- func (m *Mongo) RawExec(ctx context.Context, query string) error
- func (m *Mongo) Read(ctx context.Context, project, col string, req *model.ReadRequest) (interface{}, error)
- func (m *Mongo) Update(ctx context.Context, project, col string, req *model.UpdateRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mongo ¶
type Mongo struct {
// contains filtered or unexported fields
}
Mongo holds the mongo session
func (*Mongo) Aggregate ¶
func (m *Mongo) Aggregate(ctx context.Context, project, col string, req *model.AggregateRequest) (interface{}, error)
Aggregate performs a mongo db pipeline aggregation
func (*Mongo) DescribeTable ¶ added in v0.12.0
func (m *Mongo) DescribeTable(ctx context.Context, project, dbType, col string) ([]utils.FieldType, []utils.ForeignKeysType, error)
DescribeTable return a structure of sql table
func (*Mongo) GetCollections ¶ added in v0.12.0
func (m *Mongo) GetCollections(ctx context.Context, project string) ([]utils.DatabaseCollections, error)
GetCollections returns collection / tables name of specified database
func (*Mongo) IsClientSafe ¶ added in v0.12.0
IsClientSafe checks whether database is enabled and connected
func (*Mongo) RawBatch ¶ added in v0.12.0
RawBatch performs a batch operation for schema creation NOTE: not to be exposed externally
func (*Mongo) RawExec ¶ added in v0.12.0
RawExec performs an operation for schema creation NOTE: not to be exposed externally
Click to show internal directories.
Click to hide internal directories.