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 committed Jul 20, 2022
1 parent cbf08ad commit b832f24
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 b832f24

Please sign in to comment.