erquhart
erquhart10mo ago

Dashboard item order changes on filter

By default, dashboard data is sorted by _creationTime descending. I don't know if it's always been this way, but adding a filter changes the ordering, and it seems almost random. Labeled this a bug because it seems like one, but not certain that's the case.
4 Replies
lee
lee10mo ago
I believe dashboard filters try to use an index if they can (for efficiency), so if your filter fields are the prefix of an index, order will change to be based on the rest of the index fields. This does sound unexpected though; we might want to make the order more obvious
erquhart
erquhartOP10mo ago
Lowest effort I can think of that would work: print the name of the index being used up top and provide a checkbox to opt out of using the index. That would do it for me without getting into major sorting related improvements.
ari
ari10mo ago
Thanks for the feedback, it's a lame little snag of using an index here and we should be doing it more transparently. We have some work on the backburner to let you pick your sort order (if you have indexes) in the dashboard instead of acting like a query planner. We'll look into making this better, but for now a quick work-around would be to make the first filter match everything e.g. _id != null and that will fall back to normal indexing
erquhart
erquhartOP10mo ago
That all sounds awesome, thanks for sharing that. Great workaround, unblocks me 👍

Did you find this page helpful?