Skip to content

How to Query Data and Sort it in descending order using the number? #1859

Answered by kokamkarsahil
JenuelDev asked this question in Q&A
Discussion options

You must be logged in to vote

Update:

$numeric is boolean and it has to use with field

const myWork = await queryContent("/my-work").sort({ _id: -1, $numeric: true }).find();

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@nobkd
Comment options

@JenuelDev
Comment options

@nobkd
Comment options

@JenuelDev
Comment options

@arkaroy135
Comment options

Answer selected by JenuelDev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants