database - Rethinkdb 完全搜索包含文本
问题描述
我有很多尝试在 rethinkdb 中搜索字符串的相同部分,但我还不能这样做。我收到这个错误:
db.table("jobs")
.filter(db.row("title").contains(title))
.filter({ locationCode: location })
.run()
.then(result => {
res.json({
result,
meta: {
title,
location,
count: result.length,
},
});
});
错误:
Unhandled rejection ReqlLogicError: Cannot convert STRING to SEQUENCE in:
r.table("jobs").filter(r.row("title").contains("front")).filter({
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
locationCode: "216"
})
我正在使用rethinkdbdash库。请帮我解决这个问题。
解决方案
contains用于检查元素是否存在于序列中
进行字符串搜索时将使用match
推荐阅读
- java - JPA Postgres - 无法将动态 JSON 转换为 Java 类型
- matlab - 在 uitab 上创建具有多个轴的图。在 Matlab 中使用 addaxis
- java - Java 8:如何检查对象的所有字段是否为 NULL,除了一个
- user-interface - 我想从剪贴板复制、粘贴和剪切 CEdit 中的内容
- powershell-3.0 - 在 power-shell 工作流中使用 CSV 导入
- reactjs - 如何从客户端在 S3 中上传大型媒体文件?
- sql - 查询地理坐标内的所有点
- oracle - Oracle 10 G 中的条件索引 | REGEXP_REPLACE 函数
- sql - 选择sql组中的不同列
- python - 通过python同步拉取确认pubsub消息不起作用