# Problem with loops

**URL:** <https://discourse.nodered.org/t/problem-with-loops/43376>\
**Category:** General\
**Created:** [29 March 2021 20:45 UTC](https://discourse.nodered.org/t/problem-with-loops/43376 "2021-03-29T20:45:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fikerplunk](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@fikerplunk](https://discourse.nodered.org/u/fikerplunk)\
**Post date:** [29 March 2021 20:45 UTC](https://discourse.nodered.org/t/problem-with-loops/43376/1 "2021-03-29T20:45:14Z")

</div>

Hi guys!

I am trying to implement a way for the firestore database to become more dynamic and I have succeeded, I just need one thing.

The flow:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/f/6ffa92432868b50da61b8303d151e7355a8ef1d6.png)

the orange node is the firestore node (node-red-contrib-cloud-firestore) and the loop node is the node-red-contrib-loop-processing.  
So, I'm taking all the names of the collections from my database to create a path and set it in msg.firestore.collection, for example: "place / nameOfKey / locker". It worked, I can get the data for each collection in the same stream separately. However, when updating the database (firebase), only the data from the last collection is updated. I can't think of a way to update any of the collections. Would anyone have any tips?

Thank you for your attention, thank you very much!

[flows (4).json](https://discourse.nodered.org/uploads/short-url/8bRwsbE8hNGuYCNSfZhQrLLApoh.json) (2.9 KB)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 May 2021 20:45 UTC](https://discourse.nodered.org/t/problem-with-loops/43376/2 "2021-05-28T20:45:29Z")

</div>

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