mongo

package
v0.0.0-...-cc72008 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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) Count

func (m *MongoAdapter) Count(className string, schema, query types.M) (int, error)

Count ...

func (*MongoAdapter) CreateClass

func (m *MongoAdapter) CreateClass(className string, schema types.M) (types.M, error)

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

func (m *MongoAdapter) DeleteFields(className string, schema types.M, fieldNames []string) error

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) Find

func (m *MongoAdapter) Find(className string, schema, query, options types.M) ([]types.M, error)

Find ...

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) HandleShutdown

func (m *MongoAdapter) HandleShutdown()

HandleShutdown 关闭数据库

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 表操作对象

type Transform

type Transform struct{}

Transform ...

func NewTransform

func NewTransform() *Transform

NewTransform ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL