Greetings. I’m looking to text search for multiple phrases (name variations) using OR conditions. I’m using a Realm function in Atlas; the collection has and index of the two fields I want to search. This forum post appears to offer a solution, but I can’t get @Doug_Tarr code to work in my function. Below is my current function; what I’d like is for the search term “Pink Panther” to be an array of OR variations ([“Pink Panther”, “Pinkerton J. Panther”, “Pinky Pants”, etc.]). Thanks!
exports = async function(request){
return await db.collection
.find({ $text: { $search: "Pink Panther" } })
.sort( { "Published": -1, "_id": 1 } )
.limit(10)
.toArray();
}