【问题标题】:How to Use regular expression in Redash Mongo Json Query如何在 Redash Mongo Json Query 中使用正则表达式
【发布时间】:2021-02-18 23:21:58
【问题描述】:

我有 MongoDB 作为数据源。我想在 redash 中查询,这将等同于以下内容:-

db.collection.find({“templateId”:/XYZ$/})

此查询返回集合中键 templateId 以字符串 XYZ 结尾的所有数据。如何在 redash JSON 中使用它?

还请帮助在 Redash 中使用 $exist。

【问题讨论】:

    标签: redash


    【解决方案1】:

    通过谷歌搜索相同的问题。

    在我看来,下一个管道步骤有效:

    {"$match": {"templateId": {"$regex": "XYZ$"}}}
    

    【讨论】:

      【解决方案2】:

      我将此示例与 Redash 一起使用。

      {
          "collection": "Users",
          "query": {
              "Phone": {
                  "$regex": "1234$"
              }
          }
      }
      
      
      
      
      
      
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-02-21
        • 1970-01-01
        • 2017-03-04
        • 2013-07-08
        • 1970-01-01
        • 2016-08-04
        • 2020-09-14
        相关资源
        最近更新 更多