Documentation ¶
Index ¶
- type ErrorDuplicateKey
- type HxMongo
- func (cli *HxMongo) Aggregate(dbName string, collName string, pipeline interface{}) (*mongo.Cursor, error)
- func (cli *HxMongo) Count(dbName string, collName string, filter interface{}, opts *options.CountOptions) (int64, error)
- func (cli *HxMongo) CreateCollection(dbName, collName string) error
- func (cli *HxMongo) CreateCollectionIndex(dbName, collName string, indexModels []mongo.IndexModel) ([]string, error)
- func (cli *HxMongo) Delete(dbName string, collName string, filter interface{}, bMany bool) (int64, error)
- func (cli *HxMongo) DeleteCollection(dbName, collName string) error
- func (cli *HxMongo) Find(dbName string, collName string, filter interface{}, opts *options.FindOptions) (*mongo.Cursor, error)
- func (cli *HxMongo) FindOne(dbName string, collName string, filter interface{}, ...) (*mongo.SingleResult, error)
- func (cli *HxMongo) GetCollection(dbName, collName string) *mongo.Collection
- func (cli *HxMongo) GetCollectionNames(dbName string) ([]string, error)
- func (cli *HxMongo) GetDatabase(dbName string) *mongo.Database
- func (cli *HxMongo) HasCollection(dbName, collName string) (bool, error)
- func (cli *HxMongo) InsertMany(dbName string, collName string, documents []interface{}) ([]interface{}, error)
- func (cli *HxMongo) InsertOne(dbName, collName string, document interface{}) (interface{}, error)
- func (cli *HxMongo) Replace(dbName string, collName string, filter interface{}, replacement interface{}) (interface{}, error)
- func (cli *HxMongo) Transaction(ctx context.Context, fn func(mongo.SessionContext) error) error
- func (cli *HxMongo) Update(dbName string, collName string, filter interface{}, update interface{}, ...) (interface{}, int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorDuplicateKey ¶
type ErrorDuplicateKey struct { }
func (*ErrorDuplicateKey) Error ¶
func (e *ErrorDuplicateKey) Error() string
type HxMongo ¶
type HxMongo struct {
// contains filtered or unexported fields
}
func ConnectMongoDb ¶
ConnectMongoDb https://docs.mongodb.com/manual/reference/connection-string/
func (*HxMongo) CreateCollection ¶
func (*HxMongo) CreateCollectionIndex ¶
func (*HxMongo) DeleteCollection ¶
func (*HxMongo) FindOne ¶
func (cli *HxMongo) FindOne(dbName string, collName string, filter interface{}, opts *options.FindOneOptions) (*mongo.SingleResult, error)
func (*HxMongo) GetCollection ¶
func (cli *HxMongo) GetCollection(dbName, collName string) *mongo.Collection
func (*HxMongo) GetCollectionNames ¶
func (*HxMongo) HasCollection ¶
func (*HxMongo) InsertMany ¶
func (*HxMongo) Transaction ¶
Click to show internal directories.
Click to hide internal directories.