func NewClient(c Configuration) (*Client, error) {
	client, err := mongo.NewClient(options.Client().ApplyURI(c.MongoURL))

	if err != nil {
		return nil, err
	}

	if err := client.Connect(context.Background()); err != nil {
		return nil, err
	}

	return &Client{Client: client, Database: c.Database}, nil
}
// NewClient creates a new mongo session
NewClient creates a new mongo session
// NewClient creates a new mongo session
func NewClient(c Configuration) (*Client, error) {
	client, err := mongo.NewClient(options.Client().ApplyURI(c.MongoURL))
	if err != nil {
		return nil, err
	}
	if err := client.Connect(context.Background()); err != nil {
		return nil, err
	}
	return &Client{Client: client, Database: c.Database}, nil
}
func NewClient ( c Configuration ) ( * Client , error ) { client , err := mongo . NewClient ( options . Client ( ) . ApplyURI ( c . MongoURL ) ) if err != nil { return nil , err } if err := client . Connect ( context . Background ( ) ) ; err != nil { return nil , err } return & Client { Client : client , Database : c . Database } , nil }
NewClient creates a new mongo session
NewClient creates a new mongo session