// GetUserByUsername return a list of users search by username
GetUserByUsername return a list of users search by username
// GetUserByUsername return a list of users search by username
func (ur *UserMongoRepository) GetUserByUsername(username string) []models.User {
	session, db := database.GetSessionAndDB(database.MONGO_DB)
	query := bson.M{"$or": []bson.M{bson.M{"username": username}}}
	var users []models.User
	db.C(USERS_COLLECTION).Find(query).All(&users)
	database.MongoDBPool.Close(session)
	return users
}
func ( ur * UserMongoRepository ) GetUserByUsername ( username string ) [ ] models . User { session , db := database . GetSessionAndDB ( database . MONGO_DB ) query := bson . M { " " : [ ] bson . M { bson . M { " " : username } } } var users [ ] models . User db . C ( USERS_COLLECTION ) . Find ( query ) . All ( & users ) database . MongoDBPool . Close ( session ) return users }
GetUserByUsername return a list of users search by username
GetUserByUsername return a list of users search by username