Execute firestore for each item in input

hello all,

I am trying to get all documents of all my collections in firesbase.
first I have a node to get the collection that output 5 items

[
  {
    "name": "one"
  },
  {
    "name": "two"
  },
  {
    "name": "three"
  },
  {
    "name": "four"
  },
  {
    "name": "five"
  }
]

then I am sending the 5 items to another node to get all documents and in the collection field I put
{{$json["name"]}} but the 25 items the node is returning are the 25 documents of the first collection.

I thought that a node was executed for each item in input.
Can you tel me how to do this I am sure it is simple.

thanks
Alex

Hi @Alexandre_Husset, welcome to the community :tada:

I am very sorry to hear you’re having trouble here. In general, you’re right with this:

I thought that a node was executed for each item in input.

There are, however, a few exceptions and these mostly apply to database nodes. You can find them listed here:

To fetch the data for each collection, you’d need to use the Split In Batches node and then loop through each collection. Like so:

Hope this helps! Give me a shout if you have any trouble with this example.

1 Like