MongoDB Find Does not Run for All Input

Using the latest version of n8n.
Would like to do a Mongo DB lookup for each input items. But it appears to query only the first item only.

Settings

Hi @BeStill :wave: I’m not too sure exactly what you’re trying to do without all of the template information, but the MongoDB node doesn’t support multiple input items I’m afraid, so if this is the case you would need to add a split in batches node before it.

If you’d like to see that functionality added, could you make a feature request over on that section of the forums?

1 Like

@EmeraldHerald That’s exactly the case. Thanks. I solved it by using a split in batches node before a mongoDB query.

By the way, I’m wondering if that be the same case for HTTP Request as well? I have a HTTP request that would need to make to lookup each input item against a list. But it fails me occasionally, getting a empty result for more than 30 input items. However, if I copy and paste these two nodes out of my main workflow(which has more than 50 nodes) and run it with those 30ish exact same input items. I got more than 20 outputs successfully. Do you have any idea what’s going on?

Hi @BeStill - I’m not too sure what’s going on there, but it sounds like possibly there’s too many API calls to the service? You could try the split in batches node to split those requests into smaller chunks, and see if that helps. If it doesn’t, could you make a new thread and do what you did here - share your workflow, n8n version, etc. and we can take a look? :slight_smile:

@EmeraldHerald - I suspected the same thing. That’s why I tried using split in batches node the split those request into even 1 request for each batch. But still not working. All requests return empty output. But if I take the same input and same query out of the big workflow, and test it in a new empty workflow, it works just fine. All inputs receive a successful response this time.

I might just make a new thread and share some more details there.

1 Like

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