Are Cloud Firestore queries still case sensitive?

2020-04-02 08:57发布

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

Does this still apply for Firestore?

1条回答
爷的心禁止访问
2楼-- · 2020-04-02 09:49

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

查看更多
登录 后发表回答