Documentation ¶
Index ¶
- type Database
- func (d *Database) CommitTransaction(table string, transactionId string) (body string, err error)
- func (d *Database) Count(table string, query *query.Query, transactionId ...string) (body string, err error)
- func (d *Database) DeleteDocument(table, docId string, transactionId ...string) (body string, err error)
- func (d *Database) DeleteMany(table string, query *query.Query, transactionId ...string) (body string, err error)
- func (d *Database) DeleteOne(table string, query *query.Query, transactionId ...string) (body string, err error)
- func (d *Database) Find(table string, query *query.Query, limit, skip uint64, fields bson.M, ...) (body string, err error)
- func (d *Database) GetDocument(table, docId string, limit, skip uint64, fields bson.M, sort bson.M, ...) (body string, err error)
- func (d *Database) HttpDeleteJson(path string, request interface{}, headers ...map[string]string) (body string, err error)
- func (d *Database) HttpGetJson(path string, params url.Values, headers ...map[string]string) (body string, err error)
- func (d *Database) HttpPatchJson(path string, request interface{}, headers ...map[string]string) (body string, err error)
- func (d *Database) HttpPostJson(path string, request interface{}, headers ...map[string]string) (body string, err error)
- func (d *Database) InsertDocument(table, docId string, data bson.M, transactionId ...string) (body string, err error)
- func (d *Database) InsertDocuments(table string, data []bson.M, transactionId ...string) (body string, err error)
- func (d *Database) RollbackTransaction(table string, transactionId string) (body string, err error)
- func (d *Database) SetDocument(table, docId string, data bson.M, transactionId ...string) (body string, err error)
- func (d *Database) Transaction(table string) (body string, err error)
- func (d *Database) UpdateDocument(table, docId string, data bson.M, transactionId ...string) (body string, err error)
- func (d *Database) UpdateMany(table string, query *query.Query, data bson.M, transactionId ...string) (body string, err error)
- func (d *Database) UpdateOne(table string, query *query.Query, data bson.M, transactionId ...string) (body string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
数据库 https://docs.cloudbase.net/api-reference/openapi/database.html
func (*Database) CommitTransaction ¶
提交事务 https://docs.cloudbase.net/api-reference/openapi/database.html#transaction
func (*Database) Count ¶
func (d *Database) Count(table string, query *query.Query, transactionId ...string) (body string, err error)
统计查询文档总数 https://docs.cloudbase.net/api-reference/openapi/database.html#count
func (*Database) DeleteDocument ¶
func (d *Database) DeleteDocument(table, docId string, transactionId ...string) (body string, err error)
单文档删除 https://docs.cloudbase.net/api-reference/openapi/database.html#deletedocument
func (*Database) DeleteMany ¶
func (d *Database) DeleteMany(table string, query *query.Query, transactionId ...string) (body string, err error)
批量查询并批量删除 https://docs.cloudbase.net/api-reference/openapi/database.html#deletemany
func (*Database) DeleteOne ¶
func (d *Database) DeleteOne(table string, query *query.Query, transactionId ...string) (body string, err error)
批量查询并删除单文档 https://docs.cloudbase.net/api-reference/openapi/database.html#deleteone
func (*Database) Find ¶
func (d *Database) Find(table string, query *query.Query, limit, skip uint64, fields bson.M, sort util.OrderedMap, transactionId ...string) (body string, err error)
批量查询文档 https://docs.cloudbase.net/api-reference/openapi/database.html#find
func (*Database) GetDocument ¶
func (d *Database) GetDocument(table, docId string, limit, skip uint64, fields bson.M, sort bson.M, transactionId ...string) (body string, err error)
单文档查询 https://docs.cloudbase.net/api-reference/openapi/database.html#getdocument
func (*Database) HttpDeleteJson ¶
func (d *Database) HttpDeleteJson(path string, request interface{}, headers ...map[string]string) (body string, err error)
可直接使用Delete请求
func (*Database) HttpGetJson ¶
func (d *Database) HttpGetJson(path string, params url.Values, headers ...map[string]string) (body string, err error)
可直接使用Get请求
func (*Database) HttpPatchJson ¶
func (d *Database) HttpPatchJson(path string, request interface{}, headers ...map[string]string) (body string, err error)
可直接使用Patch请求
func (*Database) HttpPostJson ¶
func (d *Database) HttpPostJson(path string, request interface{}, headers ...map[string]string) (body string, err error)
可直接使用Post请求
func (*Database) InsertDocument ¶
func (d *Database) InsertDocument(table, docId string, data bson.M, transactionId ...string) (body string, err error)
单文档插入 https://docs.cloudbase.net/api-reference/openapi/database.html#insertdocument
func (*Database) InsertDocuments ¶
func (d *Database) InsertDocuments(table string, data []bson.M, transactionId ...string) (body string, err error)
批量插入文档 https://docs.cloudbase.net/api-reference/openapi/database.html#insertdocuments
func (*Database) RollbackTransaction ¶
提交事务 https://docs.cloudbase.net/api-reference/openapi/database.html#transaction
func (*Database) SetDocument ¶
func (d *Database) SetDocument(table, docId string, data bson.M, transactionId ...string) (body string, err error)
单文档替换更新 https://docs.cloudbase.net/api-reference/openapi/database.html#setdocument
func (*Database) Transaction ¶
开始事务 https://docs.cloudbase.net/api-reference/openapi/database.html#transaction
func (*Database) UpdateDocument ¶
func (d *Database) UpdateDocument(table, docId string, data bson.M, transactionId ...string) (body string, err error)
单文档更新 https://docs.cloudbase.net/api-reference/openapi/database.html#updatedocument