Documentation ¶
Index ¶
- func IsNoDocuments(err error) bool
- func Mongo(ctx context.Context, config *configs.Config) error
- type Client
- type Config
- type CtxCollection
- func (c *CtxCollection) Aggregate(pipeline interface{}, opts ...*options.AggregateOptions) (*mongo.Cursor, error)
- func (c *CtxCollection) BulkWrite(requests []mongo.WriteModel, opts ...*options.BulkWriteOptions) (*mongo.BulkWriteResult, error)
- func (c *CtxCollection) Clone(opts ...*options.CollectionOptions) (*CtxCollection, error)
- func (c *CtxCollection) CountDocuments(filter interface{}, opts ...*options.CountOptions) (int64, error)
- func (c *CtxCollection) DeleteMany(filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
- func (c *CtxCollection) DeleteOne(filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
- func (c *CtxCollection) Distinct(fieldName string, filter interface{}, opts ...*options.DistinctOptions) ([]interface{}, error)
- func (c *CtxCollection) Drop() error
- func (c *CtxCollection) EstimatedDocumentCount(opts ...*options.EstimatedDocumentCountOptions) (int64, error)
- func (c *CtxCollection) Find(filter interface{}, opts ...*options.FindOptions) (*mongo.Cursor, error)
- func (c *CtxCollection) FindOne(filter interface{}, opts ...*options.FindOneOptions) *mongo.SingleResult
- func (c *CtxCollection) FindOneAndDelete(filter interface{}, opts ...*options.FindOneAndDeleteOptions) *mongo.SingleResult
- func (c *CtxCollection) FindOneAndReplace(filter interface{}, replacement interface{}, ...) *mongo.SingleResult
- func (c *CtxCollection) FindOneAndUpdate(filter interface{}, update interface{}, ...) *mongo.SingleResult
- func (c *CtxCollection) Indexes() *CtxIndex
- func (c *CtxCollection) InsertMany(documents []interface{}, opts ...*options.InsertManyOptions) (*mongo.InsertManyResult, error)
- func (c *CtxCollection) InsertOne(document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
- func (c *CtxCollection) Name() string
- func (c *CtxCollection) ReplaceOne(filter interface{}, replacement interface{}, opts ...*options.ReplaceOptions) (*mongo.UpdateResult, error)
- func (c *CtxCollection) UpdateMany(filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
- func (c *CtxCollection) UpdateOne(filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
- func (c *CtxCollection) Watch(pipeline interface{}, opts ...*options.ChangeStreamOptions) (*mongo.ChangeStream, error)
- type CtxIndex
- func (c *CtxIndex) CreateMany(models []mongo.IndexModel, opts ...*options.CreateIndexesOptions) ([]string, error)
- func (c *CtxIndex) CreateOne(model mongo.IndexModel, opts ...*options.CreateIndexesOptions) (string, error)
- func (c *CtxIndex) DropAll(opts ...*options.DropIndexesOptions) (bson.Raw, error)
- func (c *CtxIndex) DropOne(name string, opts ...*options.DropIndexesOptions) (bson.Raw, error)
- func (c *CtxIndex) List(opts ...*options.ListIndexesOptions) (*mongo.Cursor, error)
- func (c *CtxIndex) ListSpecifications(opts ...*options.ListIndexesOptions) ([]*mongo.IndexSpecification, error)
- type CtxMongoDatabase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNoDocuments ¶
Types ¶
type CtxCollection ¶
type CtxCollection struct {
// contains filtered or unexported fields
}
func (*CtxCollection) Aggregate ¶
func (c *CtxCollection) Aggregate(pipeline interface{}, opts ...*options.AggregateOptions) (*mongo.Cursor, error)
func (*CtxCollection) BulkWrite ¶
func (c *CtxCollection) BulkWrite(requests []mongo.WriteModel, opts ...*options.BulkWriteOptions) (*mongo.BulkWriteResult, error)
func (*CtxCollection) Clone ¶
func (c *CtxCollection) Clone(opts ...*options.CollectionOptions) (*CtxCollection, error)
func (*CtxCollection) CountDocuments ¶
func (c *CtxCollection) CountDocuments(filter interface{}, opts ...*options.CountOptions) (int64, error)
func (*CtxCollection) DeleteMany ¶
func (c *CtxCollection) DeleteMany(filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
func (*CtxCollection) DeleteOne ¶
func (c *CtxCollection) DeleteOne(filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
func (*CtxCollection) Distinct ¶
func (c *CtxCollection) Distinct(fieldName string, filter interface{}, opts ...*options.DistinctOptions) ([]interface{}, error)
func (*CtxCollection) Drop ¶
func (c *CtxCollection) Drop() error
func (*CtxCollection) EstimatedDocumentCount ¶
func (c *CtxCollection) EstimatedDocumentCount(opts ...*options.EstimatedDocumentCountOptions) (int64, error)
func (*CtxCollection) Find ¶
func (c *CtxCollection) Find(filter interface{}, opts ...*options.FindOptions) (*mongo.Cursor, error)
func (*CtxCollection) FindOne ¶
func (c *CtxCollection) FindOne(filter interface{}, opts ...*options.FindOneOptions) *mongo.SingleResult
func (*CtxCollection) FindOneAndDelete ¶
func (c *CtxCollection) FindOneAndDelete(filter interface{}, opts ...*options.FindOneAndDeleteOptions) *mongo.SingleResult
func (*CtxCollection) FindOneAndReplace ¶
func (c *CtxCollection) FindOneAndReplace(filter interface{}, replacement interface{}, opts ...*options.FindOneAndReplaceOptions) *mongo.SingleResult
func (*CtxCollection) FindOneAndUpdate ¶
func (c *CtxCollection) FindOneAndUpdate(filter interface{}, update interface{}, opts ...*options.FindOneAndUpdateOptions) *mongo.SingleResult
func (*CtxCollection) Indexes ¶
func (c *CtxCollection) Indexes() *CtxIndex
func (*CtxCollection) InsertMany ¶
func (c *CtxCollection) InsertMany(documents []interface{}, opts ...*options.InsertManyOptions) (*mongo.InsertManyResult, error)
func (*CtxCollection) InsertOne ¶
func (c *CtxCollection) InsertOne(document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
func (*CtxCollection) Name ¶
func (c *CtxCollection) Name() string
func (*CtxCollection) ReplaceOne ¶
func (c *CtxCollection) ReplaceOne(filter interface{}, replacement interface{}, opts ...*options.ReplaceOptions) (*mongo.UpdateResult, error)
func (*CtxCollection) UpdateMany ¶
func (c *CtxCollection) UpdateMany(filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
func (*CtxCollection) UpdateOne ¶
func (c *CtxCollection) UpdateOne(filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
func (*CtxCollection) Watch ¶
func (c *CtxCollection) Watch(pipeline interface{}, opts ...*options.ChangeStreamOptions) (*mongo.ChangeStream, error)
type CtxIndex ¶
type CtxIndex struct {
// contains filtered or unexported fields
}
func (*CtxIndex) CreateMany ¶
func (c *CtxIndex) CreateMany(models []mongo.IndexModel, opts ...*options.CreateIndexesOptions) ([]string, error)
func (*CtxIndex) CreateOne ¶
func (c *CtxIndex) CreateOne(model mongo.IndexModel, opts ...*options.CreateIndexesOptions) (string, error)
func (*CtxIndex) ListSpecifications ¶
func (c *CtxIndex) ListSpecifications(opts ...*options.ListIndexesOptions) ([]*mongo.IndexSpecification, error)
type CtxMongoDatabase ¶
type CtxMongoDatabase struct {
// contains filtered or unexported fields
}
func Ctx ¶
func Ctx(ctx context.Context) *CtxMongoDatabase
func NewCtxMongoDatabase ¶
func NewCtxMongoDatabase(ctx context.Context, database *mongo.Database) *CtxMongoDatabase
func (*CtxMongoDatabase) Collection ¶
func (c *CtxMongoDatabase) Collection(name string, opts ...*options.CollectionOptions) *CtxCollection
Click to show internal directories.
Click to hide internal directories.