Data Exporting Actions

Since Mona allows users to send data about the same context but from different places and points in time, there can be a number of different behaviors in the processing of the data.

This is possible using the "Actions" key in the message sent to Mona.

For example, this record (identifiable by its context id) is set to OVERWRITE the pre-existing fields and add new ones under the same context ID:

{
  "userId": "YOUR_USER_ID",
  "messages": [
    {
      "arcClass": "LOAN_APPLICATION_TUTORIAL",
      "contextId": "12345",
      "action": "OVERWRITE",
      "message": {
        "city": "Las Vegas",
        "state": "Nevada",
        "purpose": "Health",
        "credit_score": 0.7327503408171175,
        "loan_taken": false,
        "feature_1": 542,
        "feature_2": 9217
      }
    }
  ]
}

Possible Actions:

  • OVERWRITE: (default) The values in the given fields will replace values already existing in the given fields (new fields will be added to the data). This is useful when users need to OVERWRITE some existing values.

  • ADD: The values in the given fields will be added to the values already existing in these fields (will be eventually treated as arrays of values). This is useful when new data is gathered for the same context ID and needs to be added to the existing data on Mona.

  • NEW: completely reset the entire record of the given context id to only refer to the given message, so everything before this message is no longer relevant. This is useful to completely replace all existing data under the same context ID with the newly sent data.

These are currently the only actions supported, but more to be released in the future.

To make the possible “Actions” more clear, here is an example of sending new data to an existing context id, and how each “Action” will affect the record.


Did this page help you?