Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are Cloud Firestore queries still case sensitive?

Firebase Realtime Database accept queries with strings in case sensitive manner.

Does this still apply for Firestore?

like image 902
Bogac Avatar asked Oct 03 '17 23:10

Bogac


1 Answers

Yes, queries are still case sensitive.

To support case-insensitive or any other canonicalization you'll need to write a separate field that contains the canonicalized version and query against that. For example

db.collection("users").where("name", "==", "Dan")
db.collection("users").where("name_lowercase", "==", "dan")

Also see my longer answer here: Cloud Firestore Case Insensitive Sorting Using Query

like image 79
Dan McGrath Avatar answered Oct 11 '22 21:10

Dan McGrath