Hi @sambhav2612! Thanks for reaching out.
You can use .trigger() in a JS query to trigger Mongo queries and you can pass data from the JS query to dynamically populate your mongodb query. It sounds like that would be helpful here?
For example, you can loop over recordUpdates and trigger a separate mongo query for each record:
Copyable code:
tableX.recordUpdates.forEach(function(record, index) {
mongoUpdateOne.trigger({
additionalScope: {
'i': index,
},
})
})
Then the Mongo query that will be triggered by the JS code:
We have docs on scripting in Retool: https://docs.retool.com/docs/scripting-retool
Let me know if this makes sense, or if you have any additional questions!