added

Actions

TL;DR - Mona now supports new behaviors (called “Actions”) when exporting data, allowing you stronger data manipulation capabilities.

Currently when a user exports a record to Mona, if the record’s context id is new, then the record would be saved as is. If the context id of the record had already existed with previously sent data, mona would add all newly sent fields and would overwrite existing fields with new values from the newly sent record. This is the current default exporting behavior and will remain as such, but we now call this action “OVERWRITE”.

This behavior limits users that, for example, are running multiple experiments and wish to send data from each one of the experiments to the same field in the same context id (imagine a field called “experiment_ids”). Until now, users would have had to collect the participated experiment IDs from all the experiments on their side and send to Mona as one record, due to the inability to add values to an existing field.

For this, Mona now allows sending the same context id with the “ADD” action. In cases like this, when sending fields that did not exist before in that record, they will be added, but when sending fields that did exist, the values will be added to the existing values.

Mona now also allows users to completely replace a record with a newly sent record by sending it with the “NEW” action.

An additional “DELETE” action will be released in the coming weeks.
This feature is supported in our REST API and in our SDK.

When sending data, the export action is set via a param in the body of the message like so:

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

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

781781