I created indices on the text fields, the following query runs fine in Mongo.
cursor = db.collection.find({ "$text" : { "$search": "stack" } },{ "score": { "$meta": "textScore" } }).sort( {'score' : {'$meta': 'textScore'} }).skip(0).limit(4)
But when I run it using PyMongo, I get the following error:
TypeError: if no direction is specified, key_or_list must be an instance of list