UBOS Community

vova
vova

Posted on

Creating a MongoDB Database

Most programs require data storage. On the UBOS platform, you can use an external database or configure your own. To create a new database, you need to open Services by clicking the "+" button, choose the desired database, and configure it.
Image description
Once a green indicator appears in the left sidebar next to the created database, open the modal window where you can configure the new database.
Image description

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

Additional Information:

Discussion (0)