Is it okay to have many values in an enum?

Viewed 31

I have a mongoose schema that contains a field called industry which accepts string values that present in an array called companiesIndustries.

export const companySchema = new mongoose.Schema({
//...
    industry:{
        type: [String],
        enum:companiesIndustries
    }
//...

})

export const companiesIndustries = [
    'Information Technology',
    'Financial Services',
    'Logistics',
    'Supply Chain',
    'Computer Software',
    'Computer Hardware',
    'Software Development',
    'Health, Wellness, and Fitness',
    'Information Services',
    'Real Estate',
    'Transportation/Trucking/Railroads',

//...
]

The problem is companiesIndustries length is more than 100 values, and it might get bigger also. So, is it a good practice that I store the accepted values in an array like that? I know 100 values are not that much and won't consume a lot of resources, but I am just concerned if there is a better practice in my case.

Thanks in advance!

0 Answers
Related