【发布时间】:2018-07-11 08:32:25
【问题描述】:
我在我的程序中编写了以下代码,但它将每个单词都视为单独的关键字......我希望将整个句子仅视为一个关键字。
var typed =typing.substring(4,typing.indexOf(":")-3)
db.collection('Question').find({$text:{$search : typed }},{projection:{_id: 0, Question:1}}).toArray(function(err, result)
{
if(err)
console.log(err);
console.log(result);
})
$text 是我的数据库表上的索引名称。
【问题讨论】: