oferitz
oferitz13mo ago

Order desc on getManyFrom

Can you do order('desc') with the getManyFrom convex helper?
2 Replies
lee
lee13mo ago
Looks like that's not available, but that's a great feature we should add! or you could send a PR; it's open source. If you want the behavior immediately, you can copy-paste the function into your project and add order("desc")
oferitz
oferitzOP13mo ago
Thanks. Yeah, it would be a nice feature, but it's not so urgent, since you can always return to the long version of:
.query('table')
.withIndex('by_index', (q) => q.eq('someId', id))
.order('desc')
.collect()
.query('table')
.withIndex('by_index', (q) => q.eq('someId', id))
.order('desc')
.collect()

Did you find this page helpful?