Published
- 1 min read
mongodb date sort
The solution for this is noted below
mongodb date sort
Solution
db.products.find().sort({"created_at": 1}) --- 1 for asc and -1 for desc
Try other methods by searching on the site. That is if this doesn’t work