In MongoDB if I run a query like the following to get the latest trade:
db.trades.find({ sym: 'AAPL' }).sort({ d: -1 }).limit(1)
If the index on d
is created as { d: 1 }
. I.E. does it matter if the index sort is ascending or descending? Also, I have an index on sym
as well { sym: 1 }
.