【问题标题】:Performing a text search in Mongo with a filter parameter使用过滤器参数在 Mongo 中执行文本搜索
【发布时间】:2019-05-15 04:11:24
【问题描述】:

目标

与此等效的 MongoDB:
SELECT (text_matches of "pies") FROM table WHERE (published = "true")

我正在尝试什么

db.find({ $text: { $search: searchTerm } }, {published: "true"})

我无法确定 {published: "true"} 参数在查询中的位置,我在 docs 上找不到任何示例

【问题讨论】:

    标签: mongodb text-search


    【解决方案1】:

    db.find({ published: "true", $text: { $search: searchTerm }})

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-22
      • 1970-01-01
      • 2023-03-26
      • 2018-03-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-06
      相关资源
      最近更新 更多