Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Aggregate ¶ added in v0.0.4
func Aggregate[D any, U any](ctx context.Context, c TypedCollection[D], pipeline model.AggregatePipeline, opts ...*options.AggregateOptions) ([]*U, error)
Types ¶
type BulkWriteOperation ¶ added in v0.0.10
type BulkWriteOperation struct {
// contains filtered or unexported fields
}
func (*BulkWriteOperation) Execute ¶ added in v0.0.10
func (b *BulkWriteOperation) Execute(ctx context.Context) (*mongo.BulkWriteResult, error)
func (*BulkWriteOperation) UpdateOne ¶ added in v0.0.10
func (b *BulkWriteOperation) UpdateOne(update *model.TypedUpdateOneModel) *BulkWriteOperation
type TypedCollection ¶ added in v0.0.3
type TypedCollection[D any] interface { FindOne(ctx context.Context, filter model.Filter, opts ...*options.FindOneOptions) (*D, error) Find(ctx context.Context, filter model.Filter, opts ...*options.FindOptions) ([]*D, error) FindByDocIds(ctx context.Context, ids []primitive.ObjectID, opts ...*options.FindOptions) ([]*D, error) CountDocuments(ctx context.Context, filter model.Filter, opts ...*options.CountOptions) (int64, error) InsertOne(ctx context.Context, doc D) (primitive.ObjectID, error) InsertMany(ctx context.Context, docs []*D) ([]primitive.ObjectID, error) FindOneAndUpdate(ctx context.Context, m *model.FindOneAndUpdate, opts ...*options.FindOneAndUpdateOptions) (*D, error) UpdateMany(ctx context.Context, m *model.UpdateMany, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error) UpdateById(ctx context.Context, m *model.UpdateById, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error) InitializeBulkWriteOp() *BulkWriteOperation // contains filtered or unexported methods }
func NewTypedCollection ¶ added in v0.0.3
func NewTypedCollection[D any](db *mongo.Database, name string, opts ...*options.CollectionOptions) TypedCollection[D]
Click to show internal directories.
Click to hide internal directories.