Adapter for MongoDB 9.12 | webMethods Adapter for MongoDB Documentation | webMethods Adapter for MongoDB Installation and User’s Guide Documentation | Adapter Services | Configuring Dynamic Query Executor Service
 
Configuring Dynamic Query Executor Service
The Dynamic Query Executor service template is used for dynamic operations. Creating a Dynamic service allows you to execute MongoDB query directly to the adapter service as an input field. You configure Adapter services using Designer. Refer the section Before Configuring or Managing Adapter Services before you configure adapter services.
*To configure Dynamic Query Executor service
1. In Designer, right-click the package which contains the service and select New > Adapter Service.
2. Select the parent namespace, type a name for the adapter service, and click Next .
3. Select Adapter for MongoDB as the adapter type and click Next.
4. Select the appropriate Adapter Connection Name and click Next.
5. From the list of available templates, select the Dynamic Query Executor template and click Finish.
The adapter service editor for the adapter service appears. You can select the Adapter Settings tab at any time to confirm adapter service properties such as the Adapter Name, Adapter Connection Name , and Adapter Service Template .
6. Use the Dynamic Query tab to configure the collections which the operation accesses.
Select a name of Database, provide a JSON formatted query under Query at design time or runtime.
Note:
To understand the format for the input query, refer to the Database Commands section in MongoDB documentation.
a. Use the icon to create new rows as needed. You can use the icon to fill in all rows to the following table.
Field
Description/Action
Variable
Considers the variable name provided in a Query as a variable.
Note:
If the Query contains ${<var-name>}, then the var-name is considered as a variable.
Variable Type
MongoDB data types of the Variable.
Note:
If the variable type is BSON, then the query input for that variable must be a JSON string.
Input Type
Java data types of the Variable.
b. Use the icon to create new rows as needed. You can use the icon to fill in all rows to the following table.
Field
Description/Action
Document Fields
Output document field name that you want to use.
Field Type
MongoDB data type for Document Fields.
Output Field
Name of the output field based on the Document Fields.
Output Field Type
Java data type.
c. You can also use or icons to change the order of the fields or documents to ensure the parameters are parsed in the correct order.
d. Repeat this procedure until you have specified all the parameters.
7. From the File menu, select Save.
Refer the following examples to understand the Dynamic Query Executor service using query:
*The following image shows the query input variable and the output fields to generate Input/Output signature:
*The following image displays the generated input and output signatures:
*The following image displays the input query you provide at runtime for find command:
*The following image displays the results for the above input query: