Hi, I have an users collection and trying to create a proper model in mongodb / mongoose.
I just wonder how should I store selectable datas so that It would be more performant when indexing & querying.
For example, every user has one of the following study situation →
highschool, undergrad, grad, doctorate, working
I can define this field as String or Number like 1 for highschool, 2 for undergrad , 3 for grad, 4 for doctorate, 5 for working.
So we would end up with two situation →
“studycode”:“undergrad” or “studycode”:“2”
which would be more performant when I create an index or compound index on this field ?