NewMongoConfig creates a new MongoDB configuration from environment variables
()
| 25 | |
| 26 | // NewMongoConfig creates a new MongoDB configuration from environment variables |
| 27 | func NewMongoDefaultConfig() *MongoConfig { |
| 28 | return &MongoConfig{ |
| 29 | URI: os.Getenv("MONGODB_URI"), |
| 30 | Database: "ride-sharing", |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | // NewMongoClient creates a new MongoDB client |
| 35 | func NewMongoClient(ctx context.Context, cfg *MongoConfig) (*mongo.Client, error) { |