I\'m storing date as string in \"mm/dd/yyyy\" format. I want to sort by this date field. I tried below query with few test data.
db.collection.find().sort({d
With yyyy being last, that sort isn't going to work across years.
yyyy
Probably best to switch to a yyyy-mm-dd formatted string or an actual Date type. Both of those will sort correctly.
yyyy-mm-dd
Date