What is best practice for applying a custom sort function to a collection (something that goes beyond
)? I thought I'd be able to use a collection hook here but looks like there are no hooks that have access to the entire
array. Our immediate goal is to set a specific order for a related field drop down options.
Also tried a custom endpoint, but doesn't seem like that affects the local API
has access to
which will be the collection of docs you're looking for. You can apply your sort logic there and return the sorted result.