I have an array of values, such as:
let items = ["abcd", "efgh", "ijkl", "mnop"]
Sometimes there are a thousand items in this array, other times there are only a few. I also have a series of documents with a schema including:
mongoose.Schema({
name: { required: true, type: String }
})
Is there a faster way of querying for these items other than:
Model.find({ $or: [ items.map(item => ({ 'name': item })) ] }