Skip to main content
Keep each watched list bounded. Add a channel field to the messages and declare the order the list reads, index: [["channel", "at"]]. Read recent messages with ctx.list(messages.where({ channel }).by("at").descending().first(50)), and page back with ctx.page(selection, { size, cursor }). A selection no index serves is an error that names the index to add. See Indexes and Reading.