How I can use forEach in MongoDB request?

I get a Array of Objects from a request, then I want to get ID from each Object and request to MongoDB to get the elements, there is possible?

Hi @Armando_Ammar, the find operation on the MongoDB node (like most database nodes) behaves slightly differently to regular n8n nodes. It wouldn’t run for every incoming element.

So if you have multiple items and want to perform a lookup for each of these, you’d need to build a loop. Looping - n8n Documentation would have a quick example of how to do so. Let me know if you run into any trouble with this!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.