# Sort Order in queries

**URL:** https://community.silverbullet.md/t/sort-order-in-queries/4365
**Category:** Lua
**Created:** [September 10, 2026, 1:05pm UTC](https://community.silverbullet.md/t/sort-order-in-queries/4365 "2026-09-10T13:05:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![greencow](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/g/977dab/32.png) [@greencow](https://community.silverbullet.md/u/greencow)
#### Post date: [September 10, 2026, 1:05pm UTC](https://community.silverbullet.md/t/sort-order-in-queries/4365/1 "2026-09-10T13:05:34Z")

</div>

run this query to pull all meetings but it lists them oldest first... how can I just the sort order

${query[[  
from p = tags.mtg  
select templates.pageItem(p)  
order by ?????  
]]}

---

<div class="post-metadata">

### Author: ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)
#### Post date: [September 10, 2026, 1:31pm UTC](https://community.silverbullet.md/t/sort-order-in-queries/4365/2 "2026-09-10T13:31:43Z")

</div>

This should do it:

```auto
${query[[
  from p = tags.mtg
  order by p.lastModified desc
  select templates.pageItem(p)
]]}

```

---

<div class="post-metadata">

### Author: ![greencow](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/g/977dab/32.png) [@greencow](https://community.silverbullet.md/u/greencow)
#### Post date: [September 10, 2026, 6:29pm UTC](https://community.silverbullet.md/t/sort-order-in-queries/4365/3 "2026-09-10T18:29:48Z")

</div>

thank you. works... is there a resource that explains the objects and their properties so I can figure out these queries myself?

---

<div class="post-metadata">

### Author: ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)
#### Post date: [September 10, 2026, 6:39pm UTC](https://community.silverbullet.md/t/sort-order-in-queries/4365/4 "2026-09-10T18:39:59Z")

</div>

Generally there's this for pages: [page](https://silverbullet.md/Object/page) but it's not super in depth. It does show an example query with all default attributes though.
