Documentation ¶
Index ¶
- func GetStrId() string
- type Aggregate
- type Client
- type Collection
- func (c *Collection) Aggregate(ctx context.Context, pipes ...bson.D) *Aggregate
- func (c *Collection) DeleteMany(ctx context.Context, filter bson.M) error
- func (c *Collection) DeleteOne(ctx context.Context, filter bson.M) error
- func (c *Collection) Find(ctx context.Context, filter bson.M, data any) error
- func (c *Collection) FindByID(ctx context.Context, id string, data any) error
- func (c *Collection) FindByObjID(ctx context.Context, id primitive.ObjectID, data any) error
- func (c *Collection) FindOne(ctx context.Context, filter bson.M, data any) error
- func (c *Collection) InsertMany(ctx context.Context, docs []any) error
- func (c *Collection) InsertOne(ctx context.Context, doc any) error
- func (c *Collection) ReplaceOne(ctx context.Context, filter bson.M, data any) error
- func (c *Collection) UpdateMany(ctx context.Context, filter bson.M, data any) error
- func (c *Collection) UpdateOne(ctx context.Context, filter bson.M, data any) error
- type DB
- type Filter
- type ICollection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Transaction ¶
func (c *Client) Transaction(fn func(sessionContext mongo.SessionContext) error) error
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func (*Collection) DeleteMany ¶
func (*Collection) FindByObjID ¶
func (*Collection) InsertMany ¶
func (c *Collection) InsertMany(ctx context.Context, docs []any) error
func (*Collection) ReplaceOne ¶
func (*Collection) UpdateMany ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) Coll ¶
func (d *DB) Coll(name string) *Collection
func (*DB) Model ¶
func (d *DB) Model(coll ICollection) *Collection
type ICollection ¶ added in v1.6.2
type ICollection interface {
CollName() string
}
Click to show internal directories.
Click to hide internal directories.