Documentation ¶
Index ¶
- func Delete(ctx context.Context, collectionName string, opts ...*DeleteOptions) error
- func DeleteMany(ctx context.Context, collectionName string, filter interface{}) error
- func Doc2GJson(collectionName string, doc map[string]interface{}, ...) *gjson.Json
- func Docs2GJson(collectionName string, docs []map[string]interface{}, ...) *gjson.Json
- func Get(ctx context.Context, collectionName string, opts ...*GetOptions) (*gjson.Json, error)
- func Insert(ctx context.Context, collectionName string, doc interface{}, ...) (string, error)
- func InsertMany(ctx context.Context, collectionName string, docs ...interface{}) ([]string, error)
- func List(ctx context.Context, collectionName string, opts ...*ListOptions) (*gjson.Json, int, error)
- func Update(ctx context.Context, collectionName string, doc interface{}, ...) error
- func UpdateMany(ctx context.Context, collectionName string, doc interface{}, ...) error
- func Upsert(ctx context.Context, collectionName string, doc interface{}, ...) error
- type DeleteOptions
- type GetOptions
- type InsertOptions
- type ListOptions
- type UpdateOptions
- type UpsertOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(ctx context.Context, collectionName string, opts ...*DeleteOptions) error
Delete 删除单个数据
func DeleteMany ¶
DeleteMany 删除多个数据
func Doc2GJson ¶
func Doc2GJson(collectionName string, doc map[string]interface{}, includeHiddenField, includePrivateField bool, fieldNames ...string) *gjson.Json
Doc2GJson 将数据查询结果转换成 gjson
func Docs2GJson ¶
func Docs2GJson(collectionName string, docs []map[string]interface{}, includeHiddenField, includePrivateField bool, fieldNames ...string) *gjson.Json
Docs2GJson 将多个数据查询结果转换成 gjson
func Insert ¶
func Insert(ctx context.Context, collectionName string, doc interface{}, opts ...*InsertOptions) (string, error)
Insert 新建单个数据
func InsertMany ¶
InsertMany 新建多个数据
func List ¶
func List(ctx context.Context, collectionName string, opts ...*ListOptions) (*gjson.Json, int, error)
List 获取列表数据
func Update ¶
func Update(ctx context.Context, collectionName string, doc interface{}, opts ...*UpdateOptions) error
Update 更新单个数据
Types ¶
type DeleteOptions ¶
type DeleteOptions struct { Filter interface{} RaiseNotFound bool CtxUser types.ContextUser }
DeleteOptions .
type GetOptions ¶
type GetOptions struct { Filter interface{} Fields []string IgnoreFieldsCheck bool IncludeHiddenField bool IncludePrivateField bool RaiseNotFound bool CtxUser types.ContextUser }
GetOptions .
type InsertOptions ¶
type InsertOptions struct { IgnoreFieldValueCheck bool IncludeHiddenField bool IncludePrivateField bool CtxUser types.ContextUser }
InsertOptions .
type ListOptions ¶
type ListOptions struct { Filter interface{} Fields []string Sort []string Limit int64 Offset int64 IgnoreFieldsCheck bool IncludeHiddenField bool IncludePrivateField bool CtxUser types.ContextUser }
ListOptions .
type UpdateOptions ¶
type UpdateOptions struct { Filter interface{} IgnoreFieldValueCheck bool IncludeHiddenField bool IncludePrivateField bool CtxUser types.ContextUser }
UpdateOptions .
type UpsertOptions ¶
type UpsertOptions struct { Filter interface{} IgnoreFieldValueCheck bool IncludeHiddenField bool IncludePrivateField bool CtxUser types.ContextUser }
UpsertOptions .
Click to show internal directories.
Click to hide internal directories.