Documentation ¶
Index ¶
- type MongoAdapter
- func (m *MongoAdapter) AddFieldIfNotExists(className, fieldName string, fieldType types.M) error
- func (m *MongoAdapter) ClassExists(name string) bool
- func (m *MongoAdapter) Count(className string, schema, query types.M) (int, error)
- func (m *MongoAdapter) CreateClass(className string, schema types.M) (types.M, error)
- func (m *MongoAdapter) CreateObject(className string, schema, object types.M) error
- func (m *MongoAdapter) DeleteAllClasses() error
- func (m *MongoAdapter) DeleteClass(className string) (types.M, error)
- func (m *MongoAdapter) DeleteFields(className string, schema types.M, fieldNames []string) error
- func (m *MongoAdapter) DeleteObjectsByQuery(className string, schema, query types.M) error
- func (m *MongoAdapter) EnsureUniqueness(className string, schema types.M, fieldNames []string) error
- func (m *MongoAdapter) Find(className string, schema, query, options types.M) ([]types.M, error)
- func (m *MongoAdapter) FindOneAndUpdate(className string, schema, query, update types.M) (types.M, error)
- func (m *MongoAdapter) GetAllClasses() ([]types.M, error)
- func (m *MongoAdapter) GetClass(className string) (types.M, error)
- func (m *MongoAdapter) HandleShutdown()
- func (m *MongoAdapter) PerformInitialization(options types.M) error
- func (m *MongoAdapter) SetClassLevelPermissions(className string, CLPs types.M) error
- func (m *MongoAdapter) UpdateObjectsByQuery(className string, schema, query, update types.M) error
- func (m *MongoAdapter) UpsertOneObject(className string, schema, query, update types.M) error
- type MongoCollection
- type MongoSchemaCollection
- type Transform
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoAdapter ¶
type MongoAdapter struct {
// contains filtered or unexported fields
}
MongoAdapter mongo 数据库适配器
func NewMongoAdapter ¶
func NewMongoAdapter(collectionPrefix string, db *mgo.Database) *MongoAdapter
NewMongoAdapter ...
func (*MongoAdapter) AddFieldIfNotExists ¶
func (m *MongoAdapter) AddFieldIfNotExists(className, fieldName string, fieldType types.M) error
AddFieldIfNotExists 添加字段定义
func (*MongoAdapter) ClassExists ¶
func (m *MongoAdapter) ClassExists(name string) bool
ClassExists 检测数据库中是否存在指定类
func (*MongoAdapter) CreateClass ¶
CreateClass 创建类 原始位置 MongoSchemaCollection.go/addSchema
func (*MongoAdapter) CreateObject ¶
func (m *MongoAdapter) CreateObject(className string, schema, object types.M) error
CreateObject 创建对象
func (*MongoAdapter) DeleteAllClasses ¶
func (m *MongoAdapter) DeleteAllClasses() error
DeleteAllClasses 删除所有表,仅用于测试
func (*MongoAdapter) DeleteClass ¶
func (m *MongoAdapter) DeleteClass(className string) (types.M, error)
DeleteClass 删除指定表
func (*MongoAdapter) DeleteFields ¶
DeleteFields 删除字段
func (*MongoAdapter) DeleteObjectsByQuery ¶
func (m *MongoAdapter) DeleteObjectsByQuery(className string, schema, query types.M) error
DeleteObjectsByQuery 删除符合条件的所有对象
func (*MongoAdapter) EnsureUniqueness ¶
func (m *MongoAdapter) EnsureUniqueness(className string, schema types.M, fieldNames []string) error
EnsureUniqueness 创建索引
func (*MongoAdapter) FindOneAndUpdate ¶
func (m *MongoAdapter) FindOneAndUpdate(className string, schema, query, update types.M) (types.M, error)
FindOneAndUpdate ...
func (*MongoAdapter) GetAllClasses ¶
func (m *MongoAdapter) GetAllClasses() ([]types.M, error)
GetAllClasses ...
func (*MongoAdapter) GetClass ¶
func (m *MongoAdapter) GetClass(className string) (types.M, error)
GetClass ...
func (*MongoAdapter) PerformInitialization ¶
func (m *MongoAdapter) PerformInitialization(options types.M) error
PerformInitialization 性能优化初始化
func (*MongoAdapter) SetClassLevelPermissions ¶
func (m *MongoAdapter) SetClassLevelPermissions(className string, CLPs types.M) error
SetClassLevelPermissions 设置类级别权限
func (*MongoAdapter) UpdateObjectsByQuery ¶
func (m *MongoAdapter) UpdateObjectsByQuery(className string, schema, query, update types.M) error
UpdateObjectsByQuery ...
func (*MongoAdapter) UpsertOneObject ¶
func (m *MongoAdapter) UpsertOneObject(className string, schema, query, update types.M) error
UpsertOneObject ...
type MongoCollection ¶
type MongoCollection struct {
// contains filtered or unexported fields
}
MongoCollection mongo 表操作对象
type MongoSchemaCollection ¶
type MongoSchemaCollection struct {
// contains filtered or unexported fields
}
MongoSchemaCollection _SCHEMA 表操作对象
Click to show internal directories.
Click to hide internal directories.