I have CosmosDB with Mongo 4.0 API setup on Azure. Locally I run 4.0.x MongoDB instance. They are configured the same way with the same data set.
db.getCollection('route').aggregate( [
{"$match": {"routes": {"$in": [
{"from": "ABC ", "to": "DEF"}, {"from": "GHI ", "to": "JKL"}
]}, "_id": {"$ne": {"$oid": "6114f07807dbcb5a260bbe56"}}}}
])
When running this query (with a lot more routes provided) the performance decreases greatly for CosmosDB. For local MongoDB instance the query takes 50ms while on CosmosDB it is 60seconds.
Currently RU limit is set to 800RU, however according to the MAX usage it doesn't go beyond 15% when running this query.