Documentation ¶
Index ¶
- Variables
- type ClearOplogOption
- type ClearOption
- type Client
- type ClientOption
- type FindData
- type FindOption
- type FindsData
- func (obj *FindsData) Close(ctx context.Context) error
- func (obj *FindsData) Decode(val any) error
- func (obj *FindsData) Json() (gjson.Result, error)
- func (obj *FindsData) Len() int
- func (obj *FindsData) Map() map[string]any
- func (obj *FindsData) Next(ctx context.Context) bool
- func (obj *FindsData) ReTry(ctx context.Context) error
- type ObjectID
- type Oplog
- type Table
- func (obj *Table) Add(pre_ctx context.Context, document any) (primitive.ObjectID, error)
- func (obj *Table) Adds(pre_ctx context.Context, document ...any) ([]primitive.ObjectID, error)
- func (obj *Table) ClearTable(preCtx context.Context, ...) error
- func (obj *Table) ClearTables(preCtx context.Context, ...) error
- func (obj *Table) Count(pre_ctx context.Context, filter any, opts ...FindOption) (int64, error)
- func (obj *Table) DbName() string
- func (obj *Table) Del(pre_ctx context.Context, document any) (int64, error)
- func (obj *Table) Dels(pre_ctx context.Context, document any) (int64, error)
- func (obj *Table) Exist(pre_ctx context.Context, filter any) (bool, error)
- func (obj *Table) Find(pre_ctx context.Context, filter any, opts ...FindOption) (*FindData, error)
- func (obj *Table) Finds(pre_ctx context.Context, filter any, opts ...FindOption) (*FindsData, error)
- func (obj *Table) NewTable(tableName string) *Table
- func (obj *Table) TableName() string
- func (obj *Table) Tables(ctx context.Context) ([]string, error)
- func (obj *Table) Update(pre_ctx context.Context, filter any, update any, values ...map[string]any) (UpateResult, error)
- func (obj *Table) Updates(pre_ctx context.Context, filter any, update any, values ...map[string]any) (UpateResult, error)
- func (obj *Table) Upsert(pre_ctx context.Context, filter any, update any, values ...map[string]any) (UpateResult, error)
- func (obj *Table) Upserts(pre_ctx context.Context, filter any, update any, values ...map[string]any) (UpateResult, error)
- type Timestamp
- type UpateResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoDocuments = mongo.ErrNoDocuments
View Source
var NewObjectID = primitive.NewObjectID //创建一个新的objectid
View Source
var ObjectIDFromHex = primitive.ObjectIDFromHex //十六进制字符串转objectId
Functions ¶
This section is empty.
Types ¶
type ClearOplogOption ¶
type ClearOption ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
mongodb 的操作========================================================================== start
type ClientOption ¶
type FindOption ¶
type Oplog ¶
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
集合
func (*Table) ClearTable ¶
func (obj *Table) ClearTable(preCtx context.Context, Func func(context.Context, map[string]any, ObjectID) (ObjectID, error), tag string, clearOptions ...ClearOption) error
清洗集合数据
func (*Table) ClearTables ¶
func (obj *Table) ClearTables(preCtx context.Context, Func func(context.Context, []map[string]any, ObjectID) (ObjectID, error), tag string, clearOptions ...ClearOption) error
批量清洗集合数据
func (*Table) Finds ¶
func (obj *Table) Finds(pre_ctx context.Context, filter any, opts ...FindOption) (*FindsData, error)
findmany
func (*Table) Update ¶
func (obj *Table) Update(pre_ctx context.Context, filter any, update any, values ...map[string]any) (UpateResult, error)
更新一个文档
func (*Table) Updates ¶
func (obj *Table) Updates(pre_ctx context.Context, filter any, update any, values ...map[string]any) (UpateResult, error)
更新一些文档
Click to show internal directories.
Click to hide internal directories.