MongoDB Binds

Business rules can use the following binds for the integration with MongoDB. When delivering to a Mongo database with release 4.2, use the JSON Document for 4.0 bind or the MongoDB Context for 4.0 bind.

When used in conjunction with an OIEP, the 'Mongo Delivery (from release 4.2)' delivery method is available. For more information, refer to the Mongo Delivery Method topic in the Data Exchange documentation.

Each bind is defined in the sections below.

Configuration

To use any bind:

  1. Create a business rule as defined in the Creating a Business Rule, Function, or Library topic.

  2. Edit the business rule as defined in the Editing a Business Rule or Function topic.

  3. In the Edit Operation dialog, add the bind to a business rule, as defined in the Adding a Bind topic in the Resource Materials online help documentation.

  4. In the Edit Operation dialog, optionally add Messages, as defined in the Localized Messages for JavaScript Business Rules topic.

  5. In the Edit Operation dialog, add JavaScript to call the bind.

JSON Document

When used in a business action referenced from the 'Mongo delivery' plugin, this bind gives access to a JSON object for the data that has just been persisted.

When delivering data to a Mongo database newer than release 4.2, use the 'JSON Document for 4.0' bind and the 'Mongo Delivery (from release 4.2)' delivery method.

MongoDB Context

This bind gives access to an object with the following methods:

getMongo() 

The MongoDB database is accessed via the com.mongodb.Mongo object. For more information, refer to the Javadoc for the com.mongodb.Mongo object.

getContext()
getContextID()
getRawDBName()

When delivering data to a Mongo database newer than release 4.2, use the MongoDB Context for 4.0 bind and the 'Mongo Delivery (from release 4.2)' delivery method.