I want to seach an item in db by text and implement this in pipeline
(because I need to join tables).
My function is
Moralis.Cloud.define("test", async (request) => {
const query = new Moralis.Query("itemCreatedData");
const pipeline = [
{ match: { $text: { $search: "queen" } } }
]
const response = await query.aggregate(pipeline);
return response
})
But I get an error
{
"code": 141,
"error": "text index required for $text query"
}
Does the $text
works in moralis mongoDB or the only option I have is to use query.fullText