I need to find documents based on several text fields.
var term = new RegExp(req.query.search, 'i'); .find({ company_name: { $regex: term }});
Using the above, works great. However, when I try to add an extra field using
.find(...).or([{ bio: { $regex: term }}]);
he cannot get any records. I need to do this for a few more fields.
There are various text fields in the schema that are indexed, but not together as a single multi-pole index. Will this work better, and if so, are there any clear examples of this? The documentation I found was quite rare.
Any ideas?
source share