Problems sorting by a relationship field #3978
Replies: 2 comments 6 replies
-
Hi @dkanthofer - currently this is the expected behavior. We would like to accomodate sorting on relationship fields in the future, which will require building some new functionality - so I'm going to convert this to a feature request and we'll get it on our roadmap. For now, a potential workaround would be to customize the |
Beta Was this translation helpful? Give feedback.
-
hi guys is it still the current behavior ? |
Beta Was this translation helpful? Give feedback.
-
Link to reproduction
N/A
Describe the Bug
When sorting a list by a relationship field, it actually sorts by the related document's ID. It should be alphabetically sorted by the field defined in
useAsTitle
of the related collection.As you can see in the screenshot, the Testrelation column seems to be sorted randomly, while in fact this is the alphabetical order of the IDs from the related collection.
To Reproduce
relationExamples
collection, add at least a title field and define it as the useAsTitle:Payload Version
2.0.13
Adapters and Plugins
db-mongodb, bundler-webpack
Beta Was this translation helpful? Give feedback.
All reactions