15

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

Does this still apply for Firestore?

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
Bogac
  • 3,596
  • 6
  • 35
  • 58

1 Answers1

21

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

mesqueeb
  • 5,277
  • 5
  • 44
  • 77
Dan McGrath
  • 41,220
  • 11
  • 99
  • 130