Summary

MongoDB Connector it is the component which is responsible for managing connection, sending, receiving messages from a Mongo database in a Niagara station.

This component is a RealTimeConnector, this page will only contain information specific to this component.

Implementation


 Properties

  • NumberOfWorkerThreads: Number of thread used to send messages to the Database.
  • NumberOfConnectionsPerHost: Number of Connections per hosts.
  • ConnectionString: Mongo connection string.
  • ConnectionTimeout: Number of milliseconds for mongo client to wait before giving up (increase this value if your jace has high connection latency).
  • DatabaseName: Name of the database.
  • DevicesCollection: The collection where the device information/tags will be stored.
  • PointsCollection: The collection where the point's data/tags will be stored.
  • ReferencesCollection: The collection where the reference data will be stored.
  • SchedulesCollection: The collection where the schedule data will be stored.
  • AlarmsCollection: The collection where the alarm data will be stored.
  • External Messages Collection: The collection where the connector will listen for external event see Get Started with MongoDB and Niagara for more information on how it works.
    • This the document format that should be used to change a value in Niagara: 
      Message json object
          {
              deviceId:"<DeviceId>"
              pointId: "<PointId>",
      		type: "<MessageType>" // POINT_ACTION, SEND_HISTORIES
              payload:{
                  action: "<PointAction>",
                  value: <Value>
              }
          }
        • <DeviceId>: the device id in which the point is associated
        • <PointId>: the id of the point where the action will executed
        • <MessageType>: The type of the message. ex: Point_ACTION, SEND_HISTORIES
        • <PointAction>: the point action ex: SET,AUTO,EMERGENCY, AUTO_EMERGENCY, OVERRIDE
        • <Value>: the point value it should match the point type (Bool point value = true/false)

      An ACK field will be added to the document once the message has been received by the connector, but it doesn't mean that the value has been applied to the point level. If the value is correctly applied, then you should see the change in the point's collection. This is how we avoid loops and how we are certain that the value was correctly applied to the field.

  • Native Timestamp: Parse the timestamp to mongo ISO date.
  • Timestamp Field: Timestamp field name in the message.