...
Figure 1 shows the MongoDB properties without enabling the Show Expert Properties check box.
Figure 1: Component Configuration
...
Click the Connection Configuration ellipsis button to set up the configuration required to connect to MonogDB server.
Figure 2: Connection Configuration
...
Password associated with the username provided.
Query Configuration
...
Connection Timeout (in ms)
The timeout until a connection is established. If the value is zero, the timeout is not used.
Connection String
Additional Connection String.
Query Configuration
Click the Query Configuration ellipsis button to set up the configuration required to add queries.
Figure 3: Query Configuration
Any of the CRUD operations can be configured by clicking the Add button and selecting the required operation name from the menu. A Query with default Query Name and Query Type is added to the list of queries.
...
Type of Query | Description |
---|---|
INSERT | Inserts data into database collection |
BULKINSERT | Inserts multiple rows of data into 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
...
This button deletes all the queries in the query list.
INSERT
Figure 4: Insert Query Configuration
Right-click the empty space in the element-type table to add a key to insert the required field in the document.
Figure 5: Adding a new field to element-type table.
Figure 6: Right click menu on a field in Element-Type Table
Add Child: Adds a node to the parent node. Refer to http://docs.mongodb.org/manual/tutorial/model-tree-structures-with-child-references/ for further details.
...
Delete: The selected field will be deleted on clicking this button.
Figure 7: Adding children to a parent node in Element-Type Table
...
Refer to section "Input and output" for further details about the input.
Figure 8: Up-Down buttons
...
Down: Moves the selected field below the next field.
UPDATE
Figure 9: Update Query Configuration
...
Note |
---|
Equality is considered by default when none of the operators are chosen. |
DELETE
Figure 10: Delete Query Configuration
...
For further information, go through the "input and output" section.
SELECT
Figure 11: Select Query Configuration \
...
Retrieves all the fields in the document which satisfies the query condition.
Select '_id' Field:
_id field is also included in the output along with the retrieved fields.
...
We have many types of arrays like String[],Object[],Boolean[],Int[] etc which are to be selected from the cps to specify operations on that particular type.
Int []
Figure 12: Input to insert array of type int[]
...
Displays the output in XML format.
Sample Flow
Functional Demonstration
Connect a Feeder component to insert input to the MongoDB component and add a Display component to display the output.
Figure 13: Sample flow of MongoDB
Input and Output
Input for
...
the Insert operation
Insert operation Input Schemas for different JSON values are given below.
If
...
set to false
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?> <ns1:MongoRequest xmlns:ns1="http://www.fiorano.com/MONGODB/MongoDB1"> <ns1:Insert> <ns1:name>abc</ns1:name> </ns1:Insert> </ns1:MongoRequest> |
If
...
set to true
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?> <ns1:MongoRequest xmlns:ns1="http://www.fiorano.com/MONGODB/MongoDB1"> <ns1:Insert>{name:"abc"}</ns1:Insert> </ns1:MongoRequest> |
Output for the Insert operation
Figure 14: Output for insert operation
Input for
...
the Update operation
Update operation Input Schemas for different JSON values are given below.
If
...
set to false
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?> <ns1:MongoRequest xmlns:ns1="http://www.fiorano.com/MONGODB/MongoDB1"> <ns1:Update> <ns1:Condition> <ns1:qty>70</ns1:qty> </ns1:Condition> <ns1:Fields> <ns1:type>juice</ns1:type> </ns1:Fields> </ns1:Update> </ns1:MongoRequest> |
If
...
set to true
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?> <ns1:MongoRequest xmlns:ns1="http://www.fiorano.com/MONGODB/MongoDB1"> <ns1:Update> <ns1:Condition>{qty:{$gt:70}}</ns1:Condition> <ns1:Fields>{type:"juice"}</ns1:Fields> </ns1:Update> </ns1:MongoRequest> |
It modifies the "type" field as juice in the documents for which the value of "qty" is greater than or equal to 70.
Output for the Update operation
Figure 15: Output for the update operation
Input for
...
the Delete operation
Delete operation Input Schemas for different JSON values are given below.
If
...
set to false
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?> <ns1:MongoRequest xmlns:ns1="http://www.fiorano.com/MONGODB/MongoDB1"> <ns1:Delete> <ns1:name>abc</ns1:name> </ns1:Delete> </ns1:MongoRequest> |
If
...
set to true
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?> <ns1:MongoRequest xmlns:ns1="http://www.fiorano.com/MONGODB/MongoDB1"> <ns1:Delete>{name:"abc"}</ns1:Delete> </ns1:MongoRequest> |
Output for the Delete operation
Figure 16: Output for delete operation
Input for the Select operation
Select operation Input Schemas for different JSON values are given below.
If
...
set to false
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?> <ns1:MongoRequest xmlns:ns1="http://www.fiorano.com/MONGODB/MongoDB1"> <ns1:Select> <ns1:qty>70</ns1:qty> </ns1:Select> </ns1:MongoRequest> |
If
...
set to true
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?> <ns1:MongoRequest xmlns:ns1="http://www.fiorano.com/MONGODB/MongoDB1"> <ns1:Select> <ns1:Condition>{qty:{$gt:70}}</ns1:Condition> <ns1:Fields>{type:" "}</ns1:Fields> </ns1:Select> </ns1:MongoRequest> |
...
Empty value in the fields section retrieves all the fields in the documents which are satisfying the condition.
Output for the Select operation
Figure 17: Output for select operation
Points to note
- Select output type XML for Insert, Update and Delete operations and JSON for Select operation for the ease of use.
While inserting fields of 'Date' data type, please ensure that the date is in the following format to avoid exceptions:
Code Block yyyy-MM-dd'T'HH:mm:ssZ
Info title Example - "2018-09-25T17:09:58+0000" is a valid format.
- "2018-09-25T17:09:58" is not a valid format.