Versions Compared

Key

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

...

MongoDB component can be used to insert, update, delete and select data from Mongo database server.

Component The component supports both JSON and XML data in request as well as response.

Configuration

Attributes

Figure 1 shows The figure shows the MongoDB properties without enabling the Show Expert Properties check box.

...

Click the Connection Configuration ellipsis button to set up the configuration required to connect to MonogDB the MonogDB server.


Figure 2: Connection Configuration dialog box

...

Type of QueryDescription

INSERT

Inserts data into the database collection

BULKINSERTInserts multiple documents into the database collection

UPDATE

Modifies existing data in the database collection

DELETE

Deletes data from the database collection

SELECT

Retrieves data from the database collection

...

Collection name in the database on which operation is to be performed. For Insert and Update queries, if the collection specified does not exist, a new collection with the same name will be created. 

...

This button generates a list of query type which can be used for querying to MongoDB the MongoDB server.

Delete

This button is used to delete a query from the query list. The query selected will be removed from the list.

...

This operation is used to insert multiple documents into a collection. A JSON array can be specified to list the documents to be inserted.

Refer to Input the Input and Output section for the sample input and its output. In the Query Configuration window, provide a Collection name, and set JSON to "true" so that JSON array can be specified in the input to insert multiple documents into the specified collection.

...

OperatorDescription
GREATER_THANSelects those documents where the value of the field is greater than (i.e. >) the specified value.
GREATER_OR_EQUALSelects the documents where the value of the field is greater than or equal to (i.e. >=) a specified value
LESSER_THANSelects the documents where the value of the field is less than (i.e. <) the specified value
LESSER_OR_EQUALSelects the documents where the value of the field is less than or equal to (i.e. <=) the specified value.
NOT_EQUALSelects the documents where the value of the field is not equal (i.e. !=) to the specified value
INSelects the documents where the value of a field equals any value in the specified array.
NOT_IN

Selects the documents where:

  • the field value is not in the specified array or
  • the field does not exist.
Upsert
  • Enabled: Creates a new document if no document matches the query, or if a document matches the query, performs an update.
  • Disabled: New A new document is not created in case update condition is not matched.
Update multiple documents
  • Enabled: Updates all documents which matches match with the query condition.
  • Disabled: Updates only the first document that matches with the query.

...

XMLDisplays the output in XML format.

Expert Properties

Enable the Show Expert Properties checkbox to configure these properties.

 

Warning

Expert properties are meant for advanced users; use it with caution.

Image Added
Figure 14: MongoDB CPS with the Expert properties enabled and highlighted

 

Validate Input

This property determines whether the input message has to be validated against the schema defined on the input ports.

Refer to the Validate Input section in the Common Configurations page.

Error Handling Configuration

The remedial actions to be taken when a particular error occurs can be configured here.

Please refer the Error Handling section in Common Configurations page for documentation.

Pre Processing XSL Configuration

Pre Processing XSL configuration can be used to transform request message before processing it. Click the ellipses button against the property to configure the properties.

Refer to the Pre/Post Processing XSL Configuration section in the Common Configurations page for details regarding Pre Processing XSL configuration and Post Processing XSL configuration (below).

Post Processing XSL Configuration 

Post Processing XSL configuration can be used to transform the response message before sending it to the output port.

Process Message Based on Property

The property helps components to skip certain messages from processing.

Refer to the Process Message Based On a Property section in the Common Configurations page.

Target Namespace

Refer to the Target Namespace section under the Common Configurations page.

Threadpool Configuration

 This property is used when there is a need to process messages in parallel within the component, still maintaining the sequence from the external perspective. 

Refer to the Threadpool Configuration section in the Common Configurations page.

Functional Demonstration

Connect a Feeder component to insert input to the MongoDB component and add a Display component to display the output.


Figure 1415: Sample flow of MongoDB

Input and Output

...

Output for the Insert operation


Figure 1516: Output for the Insert operation

...

This will insert three documents into the collection specified in Query the Query Configuration window.


Figure 1617: Output for the Bulk Insert operation

...

Output for the Update operation


Figure 1718: Output for the Update operation

...

Output for the Delete operation


Figure 1819: Output for the Delete operation

...

Output for the Select operation


Figure 1920: Output for Select operation

...

Adaptavist ThemeBuilder EngineAtlassian Confluence