Skip to main content

MongoDB

Creating MongoDB

Image description

note

To begin, select a plan and provide a name, username, and password for your new MongoDB database.

Image description

info

Once a green indicator appears in the left sidebar next to the created database, open the modal window to configure your new database.

Image description

Connecting MongoDB to Node-RED

To use the MongoDB database in the Node-RED environment, you need to add nodes for working with MongoDB. Follow these steps:

  1. Open the Node-RED interface or editor.
  2. Click on the menu icon (usually represented by three horizontal lines) to expand the menu options.
  3. Select "Manage Palette" from the menu.
  4. In the Manage Palette window, click on the "Install" tab.
  5. Search for "node-red-node-mongodb" in the search bar.
  6. Once you find the "node-red-node-mongodb" package, click the "Install" button next to it.
  7. Wait for the installation process to complete.
  8. After the installation is finished, you can start using the MongoDB nodes in your Node-RED flows.

By installing the "node-red-node-mongodb" package, you will have access to the necessary nodes for working with MongoDB within the Node-RED environment.

After the installation, the downloaded nodes will appear in the list of available nodes.

Image description

Next, you need to enter the data of the created database into the node.

  • mongodb in - find, cound, aggregate
  • mongodb out - save, insert, update, remove

Image description

After filling in the data, you need to click on the "Update" button, followed by "Done" and then click on "Deploy". If the data has been entered correctly, the text "connected" will appear below the node, indicating a successful connection.

Image description