【发布时间】:2021-02-18 23:21:58
【问题描述】:
我有 MongoDB 作为数据源。我想在 redash 中查询,这将等同于以下内容:-
db.collection.find({“templateId”:/XYZ$/})
此查询返回集合中键 templateId 以字符串 XYZ 结尾的所有数据。如何在 redash JSON 中使用它?
还请帮助在 Redash 中使用 $exist。
【问题讨论】:
标签: redash
我有 MongoDB 作为数据源。我想在 redash 中查询,这将等同于以下内容:-
db.collection.find({“templateId”:/XYZ$/})
此查询返回集合中键 templateId 以字符串 XYZ 结尾的所有数据。如何在 redash JSON 中使用它?
还请帮助在 Redash 中使用 $exist。
【问题讨论】:
标签: redash
通过谷歌搜索相同的问题。
在我看来,下一个管道步骤有效:
{"$match": {"templateId": {"$regex": "XYZ$"}}}
【讨论】:
我将此示例与 Redash 一起使用。
{
"collection": "Users",
"query": {
"Phone": {
"$regex": "1234$"
}
}
}
【讨论】: