Cloud Firestore 查询是否仍然区分大小写? [英] Are Cloud Firestore queries still case sensitive?

查看:13
本文介绍了Cloud Firestore 查询是否仍然区分大小写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Firebase 实时数据库以区分大小写的方式接受带有字符串的查询.

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

这仍然适用于 Firestore 吗?

Does this still apply for Firestore?

推荐答案

是的,查询仍然区分大小写.

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")

也可以在这里查看我更长的答案:Cloud Firestore 不区分大小写使用查询排序

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

这篇关于Cloud Firestore 查询是否仍然区分大小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆