Firestore-查询时如何在字段上应用“字符串包含"条件? [英] Firestore - How to apply 'string contains' condition on a field while querying?

查看:40
本文介绍了Firestore-查询时如何在字段上应用“字符串包含"条件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Collection - Post
{
  "postId" : "post_124",
  "title" : "World population 2020"
}                                                                                       

如何编写查询以返回在标题"字段中包含字符串世界人口"的帖子?

How to write a query that returns posts having the string "World population" in the "title" field?

推荐答案

Firestore不支持此级别的查询.有关可能的解决方法/解决方案,请参见全文搜索.唯一可用的表达式是:

Firestore doesn't support this level of query. See Full-text search for a possible work-around/solution. The only expressions available are:

<,< =,==,>,> =,数组包含,包含在其中或包含在任何数组中.

<, <=, ==, >, >=, array-contains, in, or array-contains-any.

这篇关于Firestore-查询时如何在字段上应用“字符串包含"条件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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