Open anyinfa opened 2 months ago
We will be adding ordering on user-defined fields.
They're not implemented yet because the values are stored in the database as JSON and we wouldn't be able to efficiently order the rows.
The data is stored in the triples
table as entity_id, attribute_id, value_json
triples. The plan is to add partial indexes to the triples table, one for each type that we support. If you want to order by a custom string
attribute, we'll index it in the string
partial index and then the order by will be efficient.
Do y'all have a public roadmap for when some of these things will be added? Only ordering by serverCreatedAt
is fine for now but not ideal. Would love to be able to filter on other attributes. Also would love to be able to use $lte
etc, especially for dates.
Any update on this? This is a complete blocker for our use case, and I imagine many others.
We have collections that contain many thousands of values and cannot reasonably be sorted in memory – let alone handling pagination, etc.
Hey team! Since we launched strong types yesterday, order
is the next big thing!
You can follow along in this PR: https://github.com/instantdb/instant/pull/564
Currently, sorting is only supported based on the internal field
serverCreatedAt
. Will custom field sorting be added in the future?And multi-field sorting?