I am trying to use Workflows to call an API and populate the results into a MongoDB collection. I have tried to follow this example MongoDB Update Many Example - #2 by Tess and this example How do I populate or run dynamic mongo queries - #2 by Tess.
However in the workflow if I create a function called updateOne that populates the MongoDB and a Javascript loop that triggers this I get an error updateOne.Trigger is not a function
I just want to iterate each record in the array from an api and insert a new record if it does not exist or update an existing record if it does exist.