Breadcrumbs

Step 2 Set up the MongoDb connector for devices, points and references

Now you have your MongoDb database configured successfully, in this section you will see how to connect Niagara devices/points to a MongoDb database.


Set up the connector



  1. Open the MongoDb Connector palette.

    Screenshot 2019-07-09 at 17.17.03.png

  2. Drag and drop the MongoDbConnector to Services > Btib Service > External Connectors > Realtime Connectors folder.

    Screenshot 2019-07-09 at 17.22.33.png

  3. Double click on the connector fill-in the connection information then hit save.

    image2020-10-21_11-12-6.png

Set up a Device



  1. From the btibMongoDb palette, drag and drop the MongoDeviceExt to a device or anything that represents a group of points (it might be a Node, a folder etc.)

    image2020-10-21_11-16-24.png

  2. If you have only one connector the extension will pick it up automatically.

    image2020-5-25_14-27-30.png

  3. if you have multiple connectors, select the one in the list and hit save

    image2020-5-25_14-28-14.png

  4. Go to the database and you should see the devices collections created with the document and associated tags.

    image2020-10-21_11-24-49.png

Set up a point



  1. From the btibMongoDb palette, drag and drop the MongoPointExt to a point.

    image2020-10-21_11-20-27.png

  2. Edit the device query to point to your device which contains the Device Extension. By default, the extension will look for the parent device but you can change it to use any other component that contains a MongoDevice extension.

    image2020-5-25_14-28-58.png

  3. Go to the database and you should see points collection created with the document and associated tags.

    image2020-10-21_11-26-58.png


Setup a reference


  1. Go to the palette and drag&drop.

    image2020-10-21_11-34-8.png

  2. Modify the query to point on a device.

    image2020-10-21_11-38-16.png

  3. Change a property on the reference.
     
    image2020-10-21_11-40-51.png

  4. You should see the new value populated in the database.

    image2020-10-21_11-43-24.png

Next Step


Step 3 Send messages to MongoDB from Niagara