Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Database 按包含文本重新定义数据库完整搜索_Database_Nosql_Rethinkdb_Rethinkdb Javascript_Rethinkdbdash - Fatal编程技术网

Database 按包含文本重新定义数据库完整搜索

Database 按包含文本重新定义数据库完整搜索,database,nosql,rethinkdb,rethinkdb-javascript,rethinkdbdash,Database,Nosql,Rethinkdb,Rethinkdb Javascript,Rethinkdbdash,我在数据库中多次尝试按字符串的同一部分进行搜索,但我还不能这样做。 我收到这个错误: db.table("jobs") .filter(db.row("title").contains(title)) .filter({ locationCode: location }) .run() .then(result => { res.json({ result,

我在数据库中多次尝试按字符串的同一部分进行搜索,但我还不能这样做。 我收到这个错误:

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"
})
我正在使用数据库。
请帮助我解决此问题。

使用downcase和match,而不是contains对我有效:

.filter(db.row("title").downcase().match(title.toLowerCase()))

contains用于检查序列中是否存在元素

进行字符串搜索时将使用匹配