package db

import (
	"context"
	"log"

	"go.mongodb.org/mongo-driver/mongo"
	"go.mongodb.org/mongo-driver/mongo/options"
)

var (
	Client                            *mongo.Client
	UserCollection, Vclusters_details *mongo.Collection
)

func InitDB() {
	clientOptions := options.Client().ApplyURI("mongodb://root:example@192.168.2.177:27017/")
	client, err := mongo.Connect(context.TODO(), clientOptions)
	if err != nil {
		log.Fatal(err)
	}

	UserCollection = client.Database("vcluster").Collection("users")
	Vclusters_details = client.Database("vcluster").Collection("vclusters_details")
}
