I'm trying to filter a MongoDB collection with a .find() query and run a text search on the results to lower the cost of the query but I can't seem to be able to chain the commands.
Here's what I've tried (that doesn't work):
db.jobs.find({
"salary.max": {
$gte: 50000,
$lte: 120000
}
}).runCommand("text", {
search: "metal"
})
I've also tried the query in the reverse order, which defeats the purpose and doesn't work either.
Is there a way to chain a .runCommand() to a .find() in MongoDB?