Database connection
Overview
This section describes the use of the option to create a link
Preparing
WithTimeout
Sets the timeout of the mongo operation.
Example:
func NewUserModel(url, db, collection string) UserModel {
conn := mon.MustNewModel(url, db, collection, mon.WithTimeout(time.Second))
return &customUserModel{
defaultUserModel: newDefaultUserModel(conn),
}
}