# How Read Data from MongoDB database

**URL:** <https://discourse.nodered.org/t/how-read-data-from-mongodb-database/44582>\
**Category:** General\
**Created:** [23 April 2021 07:01 UTC](https://discourse.nodered.org/t/how-read-data-from-mongodb-database/44582 "2021-04-23T07:01:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kartiknodered](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kartiknodered/32/40448_2.png) [@Kartiknodered](https://discourse.nodered.org/u/Kartiknodered)\
**Post date:** [23 April 2021 07:01 UTC](https://discourse.nodered.org/t/how-read-data-from-mongodb-database/44582/1 "2021-04-23T07:01:22Z")

</div>

How to read data from MongoDB database using mongodb2 node.  
Actually i don't know where to write find query.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [23 April 2021 19:38 UTC](https://discourse.nodered.org/t/how-read-data-from-mongodb-database/44582/2 "2021-04-23T19:38:23Z")

</div>

I'd suggest you read the [GitHub](https://github.com/ozomer/node-red-contrib-mongodb2#usage) page Readme and go thru the issues to see if they can help you out.

I wish I could help but I've never used mongoDB

---

<div class="post-metadata">

**Author:** ![leitheim](https://avatars.discourse-cdn.com/v4/letter/l/7993a0/32.png) [@leitheim](https://discourse.nodered.org/u/leitheim)\
**Post date:** [18 June 2021 14:14 UTC](https://discourse.nodered.org/t/how-read-data-from-mongodb-database/44582/3 "2021-06-18T14:14:14Z")

</div>

Sorry I for the late answer ...  
The easiest way would be to use MongoDB2 Node itself and select from a dropdown list of operations in the MongoDB2 node. You will have to provide a proper payload in a Function node before it. You have to make sure that everything is correct with your MongoDB connection first.  
Here is the basic example but it also can be done all in the Function node itself:

 ![FindOneMDB2Node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/d/0ddb72c775114aca405bf328d94acba7b2bbb706.jpeg)  
 ![FindOneFunction](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/b/abd132d6cada19e94066e8d57770d9fd6f7eaf87.jpeg)

---

<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:** [17 August 2021 14:15 UTC](https://discourse.nodered.org/t/how-read-data-from-mongodb-database/44582/4 "2021-08-17T14:15:09Z")

</div>

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