mongodb
5/14/25Less than 1 minutecomponentmongo
mongodb Usage Example
mgo
is a simple wrapper library based on the official MongoDB Go Driver.
Click here to view the mongodb Usage Example.
mongodb Configuration
Enable MongoDB support in the YAML configuration file under the configs
directory:
# database setting
database:
driver: "mongodb"
mongodb:
# dsn format, <username>:<password>@<hostname1>:<port1>[,<hostname2>:<port2>,......]/<db>?[k=v& ......]
dsn: "root:123456@192.168.3.37:27017/account?connectTimeoutMS=15000"