【发布时间】:2021-10-13 05:55:58
【问题描述】:
我在 mongo 的终端中使用了这个查询命令,它正在使用 scor 排序
db.stores.createIndex( { name: "text", description: "text" } )
db.articles.find( { $text: { $search: "coffee" } } )
此查询正在我的终端上的 mongo 上运行 我做到了:
$collection = Yii::$app->mongodb->getCollection('mydata');
$result = $collection->find([
[
'$text' => [
'$search' => $key,
]
]
]);
该查询在终端上的 mongo 上运行良好我从以下位置复制它:https://docs.mongodb.com/manual/reference/operator/query/text/
我得到的错误:
TypeError
strtoupper(): Argument #1 ($string) must be of type string, array given
【问题讨论】:
标签: mongodb yii yii2 yii2-advanced-app yii-extensions