0

I am trying to look for a query to update a record in Mongo document using Redash. I came up with the following query but it does not work. Can anyone please help? What I know about Redash is that it uses Pymongo.

{
  "collection": "Application",
    "update": [{
      "$match": {
        "ID": "2001"
      },
      "$set": {
        "ID": "2020"
      }
    }]
}
Sohail Ahmed
  • 1,047
  • 1
  • 11
  • 27

1 Answers1

1

Never used Redash, but in pymongo the construct would be:

db = MongoClient()['mydatabase'] # Set the database connection
db.Application.update_one({"ID": "2001"}, {"$set": {"ID": "2020"}}) # Perform the update
Belly Buster
  • 8,224
  • 2
  • 7
  • 20