This commit is contained in:
2024-09-01 07:39:42 +02:00
parent be71cc40d1
commit e047b35f77
2 changed files with 4 additions and 5 deletions

View File

@ -79,7 +79,7 @@ func connectToMongo() (*mongo.Client, error) {
}
var result bson.M
if err = client.Database("Test").RunCommand(context.TODO(), bson.D{{Key: "ping", Value: 1}}).Decode(&result); err != nil {
if err = client.Database("admin").RunCommand(context.TODO(), bson.D{{Key: "ping", Value: 1}}).Decode(&result); err != nil {
log.Println("Error ping:", err)
return nil, err
}