Documentation ¶
Index ¶
- func NewTestRepository() *testRepository
- type Base
- func (base *Base) Count(ctx context.Context, filter bson.M, opts ...*options.CountOptions) (int64, error)
- func (base *Base) DeleteMany(ctx context.Context, filter bson.M) error
- func (base *Base) DeleteOne(ctx context.Context, filter bson.M) error
- func (base *Base) Find(ctx context.Context, filter bson.M, results interface{}, ...) error
- func (base *Base) FindOne(ctx context.Context, filter bson.M, result interface{}, ...) error
- func (base *Base) InsertMany(ctx context.Context, documents []interface{}, ...) (*mongo.InsertManyResult, error)
- func (base *Base) InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
- func (base *Base) Kernel() *mongoc.Base
- func (base *Base) SetSoftDelete(softDelete bool) *Base
- func (base *Base) UpdateMany(ctx context.Context, filter bson.M, update bson.M, ...) (*mongo.UpdateResult, error)
- func (base *Base) UpdateOne(ctx context.Context, filter bson.M, update bson.M, ...) (*mongo.UpdateResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestRepository ¶
func NewTestRepository() *testRepository
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base Rewrite the methods provided in mongoc.Base to support modification, new automatic update time fields and soft delete. Soft delete is off by default; And the time is stored in the form of a timestamp. 重写 mongoc.Base 中提供的方法, 使其支持修改、新增自动更新时间字段和软删除, 默认关闭软删除, 且时间以时间戳形式存储
func NewMongoBase ¶
func (*Base) InsertMany ¶
func (base *Base) InsertMany(ctx context.Context, documents []interface{}, opts ...*options.InsertManyOptions) (*mongo.InsertManyResult, error)
func (*Base) InsertOne ¶
func (base *Base) InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
func (*Base) Kernel ¶
Kernel If the rewriting part cannot meet the needs, use the original core Base 重写部分不能满足需求的则使用原核心 mongoc.Base
func (*Base) SetSoftDelete ¶
func (*Base) UpdateMany ¶
Click to show internal directories.
Click to hide internal directories.