mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
24 lines
375 B
Go
24 lines
375 B
Go
package database
|
|
|
|
import (
|
|
"context"
|
|
|
|
"go.mongodb.org/mongo-driver/mongo"
|
|
"go.mongodb.org/mongo-driver/mongo/options"
|
|
)
|
|
|
|
type Location struct {
|
|
Database string
|
|
Collection string
|
|
}
|
|
|
|
func GetNewClient() *mongo.Client {
|
|
client, err := mongo.Connect(
|
|
context.TODO(),
|
|
options.Client().ApplyURI("mongodb://db:27017/"))
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return client
|
|
}
|