Running the following text search directly on MongoDB results in no issues:
db.getCollection(\'schools\').find({ $text: { $search: \'some query s
In the current version of the native MongoDB driver, you need to include the projection key among the options for find:
const results = await collection.find( { $text: { $search: filter } }, { projection: { score: { $meta: 'textScore' } }, sort: { score: { $meta: 'textScore' } }, } ).toArray();