# Check if node-red-contrib-mongodb2 node has read all records

**URL:** <https://discourse.nodered.org/t/check-if-node-red-contrib-mongodb2-node-has-read-all-records/49020>\
**Category:** General\
**Created:** [28 July 2021 13:21 UTC](https://discourse.nodered.org/t/check-if-node-red-contrib-mongodb2-node-has-read-all-records/49020 "2021-07-28T13:21:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OmkarNodered](https://avatars.discourse-cdn.com/v4/letter/o/90ced4/32.png) [@OmkarNodered](https://discourse.nodered.org/u/OmkarNodered)\
**Post date:** [28 July 2021 13:21 UTC](https://discourse.nodered.org/t/check-if-node-red-contrib-mongodb2-node-has-read-all-records/49020/1 "2021-07-28T13:21:16Z")

</div>

I have a flow which has node-red-contrib-mongodb2 node which is using find.foreach method. This flow has a trigger node which is looping the flow for every 2 hours.  
so, How can I ensure that mongo db node has given me all the records like suppose mongo db server has 25 records and mongo db2 node will use find.foreach method that will give me records one by one, now how can I make sure that it has read all 25 records from the database?

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [28 July 2021 19:34 UTC](https://discourse.nodered.org/t/check-if-node-red-contrib-mongodb2-node-has-read-all-records/49020/2 "2021-07-28T19:34:36Z")

</div>

> [@OmkarNodered](#):
>
> how can I make sure that it has read all 25 records from the database?

why wouldnt it ? 😉  
from what you describe you're returning all records from the db .. its not a complicated query .. so just trust that the code will do what its supposed to.

if you want to check the record count returned is correct .. install the mongodb [Compass](https://www.mongodb.com/products/compass) software and run the same query to confirm, before relying on the node completely.

**[EDIT]** I am more concerned that you are still using a node that hasn't been updated for more than 4 years.  
I later remembered that about a month ago you were using using mongodb3 node .. and that you updated to [node-red-node-mongodb](https://flows.nodered.org/node/node-red-node-mongodb) instead. What happened ? why now did you install an even older one ? 😂

> [@Mongo db deprecated](https://discourse.nodered.org/t/mongo-db-deprecated/48041/4):
>
> @zenofmud and @UnborN thanks for the help.. slightly_smiling_face I have uninstalled node-red-contrib-mongodb3 and using node-red-node-mongodb, working fine.

---

<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:** [26 September 2021 19:34 UTC](https://discourse.nodered.org/t/check-if-node-red-contrib-mongodb2-node-has-read-all-records/49020/3 "2021-09-26T19:34:48Z")

</div>

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