14

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

Does this still apply for Firestore?

Dan McGrath
  • 39,648
  • 10
  • 95
  • 126
Bogac
  • 3,491
  • 4
  • 30
  • 55

1 Answers1

19

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
  • 4,226
  • 4
  • 33
  • 68
Dan McGrath
  • 39,648
  • 10
  • 95
  • 126