I have the following mongoose schema:
const schema = new Schema({
type: {
type: String,
required: true
}
…
value for above field will be enumerated using below:
const REWARD_TYPE = {
ACCURAL_POINTS: ‘Accural Points’,
PROMOTIONAL_POINTS: ‘Promotional Points’
}
As evident from above, the value contains multiple words. Later on, i need to run query to find documents with ‘type’ as ‘Accural Points’ or ‘Promotional Points’.
Would multiple words hinder the query performance? Should i modify the value to something like AccuralPoints or Accural_Points?
Another option would be to use multiple fields, type (numeric) and name (string)…
please suggest on recommended patterns.