// GetUser allows to retrieve a user by its characteristics
GetUser allows to retrieve a user by its characteristics
// GetUser allows to retrieve a user by its characteristics
func (db *Mngo) GetUser(params params.M) (*models.User, error) {
	c := db.database.Collection(models.UsersCollection)
	user := &models.User{}
	err := c.FindOne(db.context, params).Decode(&user)
	if err != nil {
		return nil, helpers.NewError(http.StatusNotFound, "user_not_found", "User not found", err)
	}
	return user, err
}
func ( db * Mngo ) GetUser ( params params . M ) ( * models . User , error ) { c := db . database . Collection ( models . UsersCollection ) user := & models . User { } err := c . FindOne ( db . context , params ) . Decode ( & user ) if err != nil { return nil , helpers . NewError ( http . StatusNotFound , " " , " " , err ) } return user , err }
GetUser allows to retrieve a user by its characteristics
GetUser allows to retrieve a user by its characteristics