How to Query Data and Sort it in descending order using the number? #1859
-
And I want to get data and sort it in descending order: const myWork = await queryContent("/my-work").sort({ $numeric: -1 }).find(); This does not work,, How to make this work? I need help,, thanks thanks :) |
Beta Was this translation helpful? Give feedback.
Answered by
kokamkarsahil
Jan 28, 2023
Replies: 1 comment 10 replies
-
Update:
const myWork = await queryContent("/my-work").sort({ _id: -1, $numeric: true }).find(); |
Beta Was this translation helpful? Give feedback.
10 replies
Answer selected by
JenuelDev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update:
$numeric
is boolean and it has to use with field