Documentation ¶
Index ¶
- Constants
- func BSONArrayBytes(data []byte) (interface{}, error)
- func BSONDecode(value interface{}) (interface{}, error)
- func NewClient() *mongo.Client
- func RestartClient()
- func SharedClient() *mongo.Client
- func Test() error
- type AgentValueQuery
- func (this *AgentValueQuery) Action(action AgentValueQueryAction) *AgentValueQuery
- func (this *AgentValueQuery) Agent(agentId string) *AgentValueQuery
- func (this *AgentValueQuery) App(appId string) *AgentValueQuery
- func (this *AgentValueQuery) Asc(field string) *AgentValueQuery
- func (this *AgentValueQuery) Attr(field string, value interface{}) *AgentValueQuery
- func (this *AgentValueQuery) Debug() *AgentValueQuery
- func (this *AgentValueQuery) Delete() error
- func (this *AgentValueQuery) Desc(field string) *AgentValueQuery
- func (this *AgentValueQuery) Execute() (interface{}, error)
- func (this *AgentValueQuery) Find() (*agents.Value, error)
- func (this *AgentValueQuery) FindAll() ([]*agents.Value, error)
- func (this *AgentValueQuery) For(field string) *AgentValueQuery
- func (this *AgentValueQuery) Group(group []string) *AgentValueQuery
- func (this *AgentValueQuery) Gt(field string, value interface{}) *AgentValueQuery
- func (this *AgentValueQuery) Gte(field string, value interface{}) *AgentValueQuery
- func (this *AgentValueQuery) Id(idString string) *AgentValueQuery
- func (this *AgentValueQuery) Insert(value *agents.Value) error
- func (this *AgentValueQuery) Item(itemId string) *AgentValueQuery
- func (this *AgentValueQuery) Limit(size int64) *AgentValueQuery
- func (this *AgentValueQuery) Lt(field string, value interface{}) *AgentValueQuery
- func (this *AgentValueQuery) Lte(field string, value interface{}) *AgentValueQuery
- func (this *AgentValueQuery) Not(field string, value interface{}) *AgentValueQuery
- func (this *AgentValueQuery) Offset(offset int64) *AgentValueQuery
- func (this *AgentValueQuery) Op(op string, field string, value interface{})
- type AgentValueQueryAction
- type Collection
- type Config
- type Query
- func (this *Query) Action(action QueryAction) *Query
- func (this *Query) Asc(field string) *Query
- func (this *Query) AscPk() *Query
- func (this *Query) Attr(field string, value interface{}) *Query
- func (this *Query) Coll() *Collection
- func (this *Query) Count() (int64, error)
- func (this *Query) Debug() *Query
- func (this *Query) Delete() error
- func (this *Query) Desc(field string) *Query
- func (this *Query) DescPk() *Query
- func (this *Query) Execute() (interface{}, error)
- func (this *Query) Find() (interface{}, error)
- func (this *Query) FindAll() (result []interface{}, err error)
- func (this *Query) For(field string) *Query
- func (this *Query) Group(group []string) *Query
- func (this *Query) Gt(field string, value interface{}) *Query
- func (this *Query) Gte(field string, value interface{}) *Query
- func (this *Query) Id(idString string) *Query
- func (this *Query) Insert(value interface{}) error
- func (this *Query) Item(itemId string) *Query
- func (this *Query) Limit(size int64) *Query
- func (this *Query) Lt(field string, value interface{}) *Query
- func (this *Query) Lte(field string, value interface{}) *Query
- func (this *Query) Not(field string, value interface{}) *Query
- func (this *Query) Offset(offset int64) *Query
- func (this *Query) Op(op string, field string, value interface{})
- func (this *Query) Or(conds ...map[string]interface{}) *Query
- func (this *Query) Result(field ...string) *Query
- func (this *Query) Update(updates maps.Map) error
- type QueryAction
Constants ¶
View Source
const ( ValueQueryActionCount = "count" ValueQueryActionSum = "sum" ValueQueryActionAvg = "avg" ValueQueryActionMin = "min" ValueQueryActionMax = "max" ValueQueryActionFind = "find" ValueQueryActionFindAll = "findAll" )
View Source
const ( QueryActionCount = "count" QueryActionSum = "sum" QueryActionAvg = "avg" QueryActionMin = "min" QueryActionMax = "max" QueryActionFind = "find" QueryActionFindAll = "findAll" )
View Source
const (
DatabaseName = "teaweb" // 数据库名
)
Variables ¶
This section is empty.
Functions ¶
func BSONArrayBytes ¶
func BSONDecode ¶
func BSONDecode(value interface{}) (interface{}, error)
func RestartClient ¶
func RestartClient()
Types ¶
type AgentValueQuery ¶
type AgentValueQuery struct {
// contains filtered or unexported fields
}
func NewAgentValueQuery ¶
func NewAgentValueQuery() *AgentValueQuery
func (*AgentValueQuery) Action ¶
func (this *AgentValueQuery) Action(action AgentValueQueryAction) *AgentValueQuery
func (*AgentValueQuery) Agent ¶
func (this *AgentValueQuery) Agent(agentId string) *AgentValueQuery
func (*AgentValueQuery) App ¶
func (this *AgentValueQuery) App(appId string) *AgentValueQuery
func (*AgentValueQuery) Asc ¶
func (this *AgentValueQuery) Asc(field string) *AgentValueQuery
func (*AgentValueQuery) Attr ¶
func (this *AgentValueQuery) Attr(field string, value interface{}) *AgentValueQuery
func (*AgentValueQuery) Debug ¶
func (this *AgentValueQuery) Debug() *AgentValueQuery
func (*AgentValueQuery) Desc ¶
func (this *AgentValueQuery) Desc(field string) *AgentValueQuery
func (*AgentValueQuery) FindAll ¶ added in v0.1.2
func (this *AgentValueQuery) FindAll() ([]*agents.Value, error)
查找多个数据
func (*AgentValueQuery) For ¶
func (this *AgentValueQuery) For(field string) *AgentValueQuery
func (*AgentValueQuery) Group ¶
func (this *AgentValueQuery) Group(group []string) *AgentValueQuery
func (*AgentValueQuery) Gt ¶
func (this *AgentValueQuery) Gt(field string, value interface{}) *AgentValueQuery
func (*AgentValueQuery) Gte ¶
func (this *AgentValueQuery) Gte(field string, value interface{}) *AgentValueQuery
func (*AgentValueQuery) Id ¶
func (this *AgentValueQuery) Id(idString string) *AgentValueQuery
设置日志ID
func (*AgentValueQuery) Insert ¶
func (this *AgentValueQuery) Insert(value *agents.Value) error
插入新数据
func (*AgentValueQuery) Item ¶
func (this *AgentValueQuery) Item(itemId string) *AgentValueQuery
func (*AgentValueQuery) Limit ¶
func (this *AgentValueQuery) Limit(size int64) *AgentValueQuery
func (*AgentValueQuery) Lt ¶
func (this *AgentValueQuery) Lt(field string, value interface{}) *AgentValueQuery
func (*AgentValueQuery) Lte ¶
func (this *AgentValueQuery) Lte(field string, value interface{}) *AgentValueQuery
func (*AgentValueQuery) Not ¶
func (this *AgentValueQuery) Not(field string, value interface{}) *AgentValueQuery
func (*AgentValueQuery) Offset ¶
func (this *AgentValueQuery) Offset(offset int64) *AgentValueQuery
func (*AgentValueQuery) Op ¶
func (this *AgentValueQuery) Op(op string, field string, value interface{})
type AgentValueQueryAction ¶
type AgentValueQueryAction = string
type Collection ¶
type Collection struct {
*mongo.Collection
}
func FindCollection ¶
func FindCollection(collName string) *Collection
func (*Collection) CreateIndex ¶
func (this *Collection) CreateIndex(indexes map[string]bool) error
创建索引
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
func (*Query) Action ¶
func (this *Query) Action(action QueryAction) *Query
type QueryAction ¶
type QueryAction = string
Click to show internal directories.
Click to hide internal directories.