How to use Onesait update destination

Upsert MongoDB mode available from version 2.1.2

Bulk of upserts on MongoDB mode available from version 2.3.0

Description

The Onesait destination stage of Dataflow updates information on the configured ontologies.

 

How to use it

Importing to the pipeline

To add it to the pipeline, search for Onesait in the stages palette like so:



 

Drag and drop to the panel.

Once imported, it can be configured to achieve different beheaviours depending on the case. 

Available configuration tabs

General

This tab shows general information and an option to show the event generator point on the stage.





Checking the "Produce Events" option the stage shows another point to make usage of the events.

The events triggered are:

  • Document modified

    • Which sends the updated records in a list (data-updated)

  • Document not modified

    • Which sends the not updated records in a list (data-not-updated)

For example, data-not-updated:

Source

This tab shows a form to fill with the Digital Broker information of the Onesait platform.



Destination

This tab shows the main form of the stage. 

  • ThreadPool: Number of threads to create.

The last two forms map the fields in the record with the data source to update the documents

  • Filtering fields: Filter applied on when updating the documents.

    • Record field: The field of the record to get the value from.

    • Operator: SQL operator.

    • Column name: The property path in the data source.

  • Update fields: Fields to update on the documents filtered in the previous form.

    • Record field: The field of the record to get the value from.

    • Column name: The property path in the data source.

If you select the Use SQL option, you can use a custom SQL query:

Example

Let's say we receive data like this simple structure.

And in our ontology we have documents with an unique index in the path user.id. 

If we want to update the properties user.first_name and user.last_name in our ontology, we would set the Destination tab like so:



We need to set the filtering field to match the record field value and the unique index in the ontology to get the document we need.

Then we would set the properties to update in the column name, based on the record fields values. 

Upsert MongoDB mode (from 2.1.2)

Starting 2.1.2 version it’s posible to use the upsert node as a upsert node (only for MongoDB ontologies) with the following configuration:

Use SQL must be unchecked and Upsert mode must be check. This mode has three config params:

  • Root node type → like in insert node you can use the root node type of the destination ontology.

  • Custom root node name → only can use when Custom root node is selected in order to specifiy the custom root node name.

  • Key fields to perform upsert → Select incoming data fields to generate the dynamic key for the record. When this key is found update is applied and when not found an insert is produced.

Bulk of Upserts on MongoDB mode (from 2.3.0)

Starting 2.3.0 version it’s posible to use bulk mode with upserts (only for MongoDB ontologies) with the following configuration:

Where Bulk is the number of queries that are going to be executed in the bulk each time.