我使用以下代码
if (typeof(searchTerm) == "string") {
let posts = await Post.reusablePostQuery([{
$match: {
$text: {
$search: searchTerm}
}
}, {
$sort: {
score: {
$meta: "textScore"
}
}
}
])我得到了以下错误
FieldPath field names may not start with '$'
发布于 2021-06-20 06:00:33
我也面临着同样的问题,但当我删除下面的代码和逗号(,)之前,它对我起作用
{
$sort: {
score: {
$meta: "textScore"
}
}
}
https://stackoverflow.com/questions/67735084
复制相似问题