//GetClient Create a MongoDB Client
GetClient Create a MongoDB Client
// GetClient Create a MongoDB Client
func GetClient() (client *mongo.Client, err error) {
	client, err = mongo.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
	if err != nil {
		return nil, err
	}
	ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
	err = client.Connect(ctx)
	if err != nil {
		return nil, err
	}
	defer client.Disconnect(ctx)
}
func GetClient ( ) ( client * mongo . Client , err error ) { client , err = mongo . NewClient ( options . Client ( ) . ApplyURI ( " " ) ) if err != nil { return nil , err } ctx , _ := context . WithTimeout ( context . Background ( ) , 10 * time . Second ) err = client . Connect ( ctx ) if err != nil { return nil , err } defer client . Disconnect ( ctx ) }
GetClient Create a MongoDB Client
GetClient Create a MongoDB Client
//TODO: Cancel Context