Adapter for MongoDB 9.12 | webMethods Adapter for MongoDB Documentation | webMethods Adapter for MongoDB Installation and User’s Guide Documentation | Adapter Services | Configuring Delete Document Service
 
Configuring Delete Document Service
A Delete Document service deletes the existing information in a collection and includes a mapping for an output field count that stores the number of documents affected by the delete operation.
Note:
Delete service internally uses MongoDB deleteMany operation. Refer to MongoDB documentation for more details on deleteMany.
Refer the section Before Configuring or Managing Adapter Services before configuring adapter services.
*To configure delete service
1. In Designer, right-click the package which the service contains 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 Delete Document 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 Collection tab to configure the collection using the following:
Field
Description/Action
Database
Displays the database name that you provide in the Connections.
Collection
Lists the collection present in the Database.
Sampling Limit
Specify the number of sampling documents to be scanned to get the Document Fields.
Acknowledgment
Requests the acknowledgment that the Write operation propagates to a specified number of mongod instances.
Journal
You select to request the acknowledgment that the mongod instances has written to the on-disk journal.
TimeOut
A time limit to avoid the Write operations from blocking indefinitely.
Bypass Document Validation
You select to enable the delete operation to bypass document validation.
7. Use Filter tab to specify the conditions using the following fields for selecting the documents that needs to be deleted:
a. Select the icon to define new fields. You can use the icon to fill in all rows to the table.
b. Select a MongoDB operator, and separators(left and right parenthesis), and specify values for the following fields:
Field
Description /Action
AND/OR
The logical operator.
Document Field
Name of the fields from sampling documents that you want to use.
To include a different field name in the filter, edit the field appropriately. For more information, see Examples of Designing Filters on an Array of Embedded Documents.
Field Type
Specifies the MongoDB data type for Document Fields.
Input Field
Provide a value for query input during the design time or runtime.
Input Field Type
Specifies Java data type.
Parameter
Displays the index of the input field.
c. You can also use or icons to change the order of the fields to ensure the parameters are parsed in the correct order.
d. Repeat this procedure until you have specified all the parameters.
8. From the File menu, select Save.