Documentation
¶
Index ¶
- type Config
- type Database
- func (d *Database) Close() error
- func (d *Database) Database(dbName ...string) *mongo.Database
- func (d *Database) ListDatabase() (mongo.ListDatabasesResult, error)
- func (d *Database) ListDatabaseNames() ([]string, error)
- func (d *Database) Open() error
- func (d *Database) Ping() error
- func (d *Database) SelectDatabase(dbName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Host string `json:"host" yaml:"host"` Port string `json:"port" yaml:"port"` User string `json:"user" yaml:"user"` Password string `json:"password" yaml:"password"` Auth string `json:"auth" yaml:"auth"` DBName string `json:"db_name" yaml:"db_name"` PoolSize int `json:"pool_size" yaml:"pool_size"` }
dsn mongodb://root:WiaQ82n7B3L5Cz*2#10m@172.18.76.150:27017?authSource=admin
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
mongodb orm use official driver
func NewDatabase ¶
func (*Database) ListDatabase ¶ added in v1.0.5
func (d *Database) ListDatabase() (mongo.ListDatabasesResult, error)
func (*Database) ListDatabaseNames ¶ added in v1.0.5
Click to show internal directories.
Click to hide internal directories.