Task: Sort a MongoDB Collection by Date
Task: Sort a MongoDB Collection by Date: a task in Terminal-Lego-15k (Harbor dataset). Create a Node.js script that connects to a MongoDB database, inserts sample documents containing JavaScript Date objects, and then queries the collection sorted by date in both ascending and descending order.
The task
Create a Node.js script that connects to a MongoDB database, inserts sample documents containing JavaScript `Date` objects, and then queries the collection sorted by date in both ascending and descending order.
Part of PrimeIntellect/Terminal-Lego-15k.