0

I have MongoDB as Data source. I want to query in redash which will be the equivalent following:-

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

This query return all data from the collection where key templateId end with string XYZ. How can I use the same in redash JSON?

Also please help in using $exist in Redash.

Nidhin Bose J.
  • 1,092
  • 15
  • 28

2 Answers2

2

I use this example with Redash.

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

Options i to make it case insensitive

Sohail Ahmed
  • 1,047
  • 1
  • 11
  • 27
0

Got here from googling the same question.

It seems to me that next pipeline step works:

{"$match": {"templateId": {"$regex": "XYZ$"}}}
ShPavel
  • 962
  • 1
  • 10
  • 17