在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库。请帮我解决这个问题。
发布于 2018-10-17 10:40:55
使用小写和匹配,而不是包含是为我工作的:
.filter(db.row("title").downcase().match(title.toLowerCase()))发布于 2018-10-17 12:17:35
包含用于检查元素是否存在于序列中。
在执行字符串搜索时将使用匹配。
https://stackoverflow.com/questions/52851012
复制相似问题