问题描述
基本上,我正在Firestore文档字段上编写搜索功能.我想写等效于下面的SQL.我没有找到继续的解决方法.
Basically I am writing a search function on a Firestore document field. I want to write equivalent of below SQL. I am not finding solution to proceed.
选择*来自员工(employee_name)较低的位置,例如'%johny%';
SELECT *FROM employeeWHERE lower(employee_name) LIKE '%johny%';
推荐答案
没有相似的运算符.在以下位置查看所有可用的运算符: https://firebase.google.com/docs/firestore /query-data/queries 该页面还包含查询数据库的不同方法.
There is no like operator. See all available operators at: https://firebase.google.com/docs/firestore/query-data/queriesThe page also contains different ways on querying the database.
对于不区分大小写的排序/查询,请参见以下答案: Cloud Firestore不区分大小写使用查询排序
For case insensitive sorting / querying please see the answer at Cloud Firestore Case Insensitive Sorting Using Query
基本上建议将小写数据存储在其他字段中.
It basically advises to store your lowercase data in an additional field.
这篇关于Firestore数据库查询,忽略大小写(区分大小写)和like子句.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!