Sorting by Date not working
See original GitHub issueHi,
For some reason, the sort feature isn’t working. Am I doing something wrong?
export const LeadsIndex = new Index({
collection: Leads,
fields: ['firstName', 'lastName', 'createdAt'],
engine: new MongoDBEngine({
sort: () => { createdAt: -1 }
}),
defaultSearchOptions: { limit: 25 }
});
Mongo is saving date as ISODate().
I even tried to sort by a field called ‘firstName’, but it didn’t work either. Please advise.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
[Fix] Excel Sort by Date Not Working (2 Causes with Solutions)
1. Change the Cell Format to Sort Date · Select all the cells first. · Press the right button of the mouse. ·...
Read more >How to Fix Excel Dates That Won't Change Format - Contextures
If you want to sort the dates in column C, or change their format, the text dates have to be converted to real...
Read more >How to sort dates from Oldest to Newest in Excel?
Click Home tab > arrow under Sort & Filter, and then click Sort Oldest to Newest, or Sort Newest to Oldest. NOTE: If...
Read more >Excel date sorting issue - Microsoft Community Hub
I need to sort it for my research. yyyy-mm-dd date formats sort, BUT the yyyy-mm, and yyyy do not sort within yyyy-mm-dd list....
Read more >Dates seem formatted correctly, but will not sort newest to oldest.
Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

shouldn’t
sort: () => { createdAt: -1 }besort: () => ({ createdAt: -1 })?Looks like invalid syntax to me.
oh yeah. Feel free to either create a PR fixing this in the gh-pages branch or creating a new issue