Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The BMongoHistoryExport is used to export history records to a Mongo database.
Each record of each targeted history will be exported as a document inside a single time series collection. To decrease the storage size inside the database, it is not possible to export records to non time series collections.
For performance reasons, the metadata is normalized, thus sent into another standard collection.
You can use the BExportChecker to check that this component works correctly.


If you have a component for which you are exporting a history, and the component has dynamic tags - such as those assigned through an attached infoSource -, then there will be a new document created in the metadata collection for each of set of tags attached to the document's record in the history. The id of this document will be the name of the component followed by '+' and then a timestamp in milliseconds. 


For example, I have a component called "Sensor" with the following tags:

Code Block
{    building: siteA,
    room: Geneva
}


I export it through BMongoHistoryExport, which will create the following record in the metadata collection:

Code Block
{
  "_id": "/myStation/Sensor+1696324872986",
  "historyId": "/myStation/Sensor",
  "historyDisplayName": "Sensor",
  "valueFacets": "units=null,precision=1,min=-inf,max=+inf",
  "building": "siteA",
  "room": "Geneva"
}


If I then change the building and the room in the component's infoSorce, then make a new record in the history and export it, the following document will be created in the mongo db:

Code Block
{
  "_id": "/myStation/Sensor+193322821234",
  "historyId": "/myStation/Sensor",
  "historyDisplayName": "Sensor",
  "valueFacets": "units=null,precision=1,min=-inf,max=+inf",
  "building": "siteB",
  "room": "Paris"
}


Each of the records in the timeseries collection will point to the right metadata document by referencing its specific id.


Note: if later on you assign to the component a set of tags that has already been used in an existing metadata document, then that document will be used instead of creating a new one.




Implementation

  1. Drag and drop the component from the palette anywhere in the station
  2. Select an existing MongoDbTSConnector in the MongoDbConnector slot.
  3. Select one or more selections.
  4. Trigger the Execute action 

...