
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGood news! GROQ now supports case-insensitive sorting using the lower() function. According to the GROQ Query Cheat Sheet, you can use:
*[_type == "company"] | order(lower(name) asc)This will convert all company names to lowercase for sorting purposes, so companies with all-caps abbreviations (like "ABC COMPANY") will be sorted alphabetically alongside companies with regular capitalization (like "Acme Corp"), rather than all uppercase names being placed at the beginning.
The lower() function works as an expression within the order() function, transforming the field value before sorting is applied. This solves the exact problem you're describing where uppercase letters sort before lowercase letters in standard alphabetical ordering.
So yes, this capability has been added to GROQ since those 2018-2019 discussions you found! You can now handle case-insensitive sorting directly in your query without needing to do additional sorting in your application code.
You can also combine this with multiple sort criteria if needed:
*[_type == "company"] | order(lower(name) asc, _createdAt desc)This approach keeps your sorting logic in GROQ where it belongs, making your queries more efficient and your frontend code cleaner.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store