Using PyMongo, is there a way to add an index hint to an aggregate query?
None of these option works with PyMongo:
db.collection.aggregate(pipeline, {'hint': 'index_name'})
db.collection.aggregate(pipeline).hint(index_name')
Using PyMongo, is there a way to add an index hint to an aggregate query?
None of these option works with PyMongo:
db.collection.aggregate(pipeline, {'hint': 'index_name'})
db.collection.aggregate(pipeline).hint(index_name')
I don't believe this is supported.
Separately, hint specifies an index to use for the particular query; an aggregation pipeline can contain many queries. Simply specifying index name would be ambiguous.