Shane
(Shane Harvey)
5
You need a compound index on {"ticker": 1, "post_publish_time":1}
For example:
coll.create_index([("ticker", ASCENDING), ("post_publish_time", ASCENDING)])
# or
coll.create_index({"ticker": ASCENDING, "post_publish_time": ASCENDING})
See https://www.mongodb.com/docs/manual/core/indexes/index-types/index-compound/
2 Likes