// FindUsersByUID fetches the user from database that matches the passed uids
FindUsersByUID fetches the user from database that matches the passed uids
// FindUsersByUID fetches the user from database that matches the passed uids
func (r repository) FindUsersByUID(uid []string) (*[]entities.User, error) {
	cursor, err := r.Collection.Find(context.Background(),
		bson.D{
			{"_id", bson.D{
				{"$in", uid},
			}},
		})
	if err != nil {
		return nil, err
	}
	var Users []entities.User
	for cursor.Next(context.TODO()) {
		var user entities.User
		_ = cursor.Decode(&user)
		Users = append(Users, *user.SanitizedUser())
	}
	return &Users, nil
}
func ( r repository ) FindUsersByUID ( uid [ ] string ) ( * [ ] entities . User , error ) { cursor , err := r . Collection . Find ( context . Background ( ) , bson . D { { " " , bson . D { { " " , uid } , } } , } ) if err != nil { return nil , err } var Users [ ] entities . User for cursor . Next ( context . TODO ( ) ) { var user entities . User _ = cursor . Decode ( & user ) Users = append ( Users , * user . SanitizedUser ( ) ) } return & Users , nil }
FindUsersByUID fetches the user from database that matches the passed uids
FindUsersByUID fetches the user from database that matches the passed uids