Cloud Firestore sorting is case sensitive. There is no flag for the sort to ignore the case.
The only way to get your use case is to save the field twice.
Say your field that stores "AAA" and "aaa" is called myData . In the client code, you need to save the second field named myData_insensitive , where you store a copy of the data that you converted to lowercase.
DocA: -> myData = 'AAA' -> myData_insensitive = 'AAA' DocB: -> myData = 'aaa' -> myData_insensitive = 'AAA' DocC: -> myData = 'BBB' -> myData_insensitive = 'BBB' DocD: -> myData = 'bbb' -> myData_insensitive = 'BBB'
Now you can order myData_insensitive , but display myData
source share