Skip to content

Commit

Permalink
docs(api): queryContent().sort() descending sorting (#1364)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas von Blarer authored and farnabaz committed Sep 7, 2022
1 parent c9b0ca1 commit 0f2a17e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/content/4.api/2.composables/1.query-content.md
Expand Up @@ -64,12 +64,12 @@ const articles = await queryContent('articles')

// Sort by title ascending first then sort by category descending
const articles = await queryContent('articles')
.sort({ title: 1, category: 0 })
.sort({ title: 1, category: -1 })
.find()
// OR
const articles = await queryContent('articles')
.sort({ title: 1 })
.sort({ category: 0 })
.sort({ category: -1 })
.find()

// Sort by nested field
Expand Down

0 comments on commit 0f2a17e

Please sign in to comment.