Contact Us 1-800-596-4880

MongoDB Connector 6.3 Reference - Mule 4

Anypoint Connector for MongoDB (MongoDB Connector) is a closed-source connector that provides a connection between the Mule runtime engine (Mule) and third-party software on a MongoDB server.

Configuration

Default Configuration for MongoDB Connector.

Name Type Description Default Value Required

Name

String

Name for this configuration. Connectors reference the configuration with this name.

x

Connection

Connection types for this configuration.

x

Read Concern

Enumeration, one of:

  • LOCAL

  • AVAILABLE

  • MAJORITY

  • LINEARIZABLE

  • SNAPSHOT

Enables you to control the consistency and isolation properties of the data read from replica sets and replica set shards.

Read Preference

Enumeration, one of:

  • PRIMARY

  • PRIMARY_PREFERED

  • SECONDARY

  • SECONDARY_PREFERRED

  • NEAREST

Specifies the read preferences for this connection.

PRIMARY

Maximum Staleness Seconds

Number

Specifies, in seconds, how stale a secondary node on a MongoDB cluster is before the client stops using the secondary node for read operations.

-1

Read Preference Tags

If replica set members are associated with tags, you can specify a tag set (array of tag specification documents) in the read preference to target those members.

Encoding

String

Specifies the encoding to use in the connector. If unspecified, the default for Mule is used.

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Write Concern Acknowledgement

String

Level of acknowledgment requested from MongoDB for write operations propagated to the specified number of MongoDB instances. You can specify a number of instances, for example, n>0, or use a value from the list.

Write Concern Timeout

Number

Specifies a time limit, in milliseconds, for Write Concern Acknowledgement. The value must be greater than 1.

Write Concern Timeout Timeunit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Write Concern Timeout field.

SECONDS

Connection Type

Uses a database, a username, and a password for connection.

This connector does not validate all possible authentication types.
Name Type Description Default Value Required

Servers (host:port)

Array of Server Address

Server in which your MongoDB instance is located. You can specify multiple servers.

x

Database

String

Database name to which you want to connect.

x

Username

String

Username to use for authentication.

Password

String

Password to use for authentication. If you do not want to use authentication, the password and the username must both be empty.

Replica Set Name

String

Name of the replica set to which to connect. Use this field to connect to a MongoDB cluster.

Authentication Source

String

Authentication source.

Compressors

Array of String

List of compressors to enable network compression for communication between the client and a mongod or mongos instance. If you specify multiple compressors, then the order in which you list the compressors matters. The driver uses the first compressor in the list.

Zlib Compression Level

Number

Integer that specifies the compression level if using zlib for network compression. 0 means no compression. 1 through 9 are the compression levels, with 1 being the lowest compression level, and 9 being the highest compression level. Higher compression levels take more time to process than lower compression levels.

-1

Connection Timeout

Number

How long the connector waits before timing out when establishing a connection to the remote service.

30

Connection Timeout Timeunit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Connection Timeout field.

SECONDS

Local Threshold

Number

Size of the latency window for selecting among multiple suitable MongoDB instances.

15

Local Threshold Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Local Threshold field.

MILLISECONDS

Server Selection Timeout

Number

How long to block for server selection before throwing an exception.

30

Server Selection Timeout Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Server Selection Timeout field.

SECONDS

Socket Timeout

Number

Socket timeout. Used for I/O socket read and write operations. Set this field to 0 if you do not want socket read and write operations to time out.

Socket Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Socket Timeout field.

SECONDS

Retry Writes

Boolean

Enable retryable writes.

false

Authentication Mechanism

Enumeration, one of:

  • PLAIN

  • SCRAM_SHA_1

  • SCRAM_SHA_256

Authentication mechanism used for this connection.

Tls Context

Tls

Configures TLS. If using the HTTPS protocol, you must configure TLS.

Min Connection Pool Size

Number

Minimum size for the connection pool.

Max Connection Pool Size

Number

Maximum size for the connection pool.

100

Max Wait Queue Time

Number

Maximum wait queue time for the connection pool.

120

Max Wait Queue Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Wait Queue Time field.

SECONDS

Max Connection Life Time

Number

Maximum connection lifetime for the connection pool.

Max Connection Life Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Connection Life Time field.

SECONDS

Max Connection Idle Time

Number

Maximum connection idle time for the connection pool.

Max Connection Idle Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Connection Idle Time field.

SECONDS

Reconnection

Configures a reconnection strategy to use when a connector operation fails to connect to an external server.

Connection String Connection Type

Uses a connection string for connection.

This connector does not validate all possible authentication types.
Name Type Description Default Value Required

Connection String

String

URI that describes the hosts to use and their options.

x

Tls Context

Tls

Configures TLS. If using the HTTPS protocol, you must configure TLS.

Reconnection

Configures a reconnection strategy to use when a connector operation fails to connect to an external server.

Sources

On Object Listener

<mongo:object-listener>

Source for object events.

This source (listener) uses Object Store to save watermarks. You might experience limitations that are specific to the Object Store implementation you are using (Object Store for CloudHub deployments or Object Store for on-premises deployments), so configure Object Store to suit your needs.
For more information, see The Different Types of Object Stores Explained.
Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Collection that is watched to detect the matching documents.

x

Watermark Field

String

Field that is queried to detect the objects that match the trigger condition.

x

Primary Node Only

Boolean

Determines whether to execute this source on only the primary node when running Mule instances in a cluster.

Scheduling Strategy

scheduling-strategy

Configures the scheduler that triggers the polling.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Redelivery Policy

Defines a policy for processing the redelivery of the same message.

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Binary

Associated Configurations

Operations

Add User

<mongo:add-user>

Adds a new user for this database.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Username

String

Name of the user.

x

Password

String

Password to use for authentication.

x

Reconnection Strategy

Retry strategy in case of connectivity errors.

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Collection Exists

<mongo:collection-exists>

Returns true if the specified collection exists.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Name of the collection.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Boolean

Associated Configurations

Throws

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Count Documents

<mongo:count-documents>

Counts the number of documents that match the given query. If no query is passed, the operation returns the number of elements in the collection.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Target collection.

x

Query

Binary

Query for counting documents. Only documents matching the query are counted. If unspecified, all documents are counted. Values can be {"field1": "value1"} or can contain operators {"field1": {$gte: 1, $lt: 10}}.

Write Concern Acknowledgement

String

Level of acknowledgment requested from MongoDB for write operations propagated to the specified number of MongoDB instances. You can specify a number of instances, for example, n>0, or use a value from the list.

Write Concern Timeout

Number

Specifies a time limit, in milliseconds, for Write Concern Acknowledgement. The value must be greater than 1.

Write Concern Timeout Timeunit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Write Concern Timeout field.

SECONDS

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Number

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Create Collection

<mongo:create-collection>

Creates a new collection. If the collection already exists, a MongoException is thrown.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Name of the collection to create.

x

Max Objects

Number

Maximum number of documents the new collection contains.

Collection Size

Number

Maximum size of the new collection.

Collection Size Data Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Data unit of the Collection Size field.

BYTE

Reconnection Strategy

Retry strategy in case of connectivity errors.

Associated Configurations

Throws

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Create File

<mongo:create-file>

Creates a new file in the database, saving the specified content, file name, content type, and extra data.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Content

Binary

Content of the new file. This content is an InputStream.

#[payload]

x

Filename

String

Name of the new file.

x

Metadata

Binary

JSON object that holds information to store.

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Binary

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Create Index

<mongo:create-index>

Creates a new index.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Name of the collection in which the index is created.

x

Field Name

String

Name of the field that is indexed.

x

Sort Order

Enumeration, one of:

  • ASC

  • DESC

Indexing order.

ASC

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

String

Associated Configurations

Throws

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Drop Collection

<mongo:drop-collection>

Deletes a collection and all the objects it contains. If the collection does not exist, the operation throws a NOT_FOUND error.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Name of the collection to drop.

x

Reconnection Strategy

Retry strategy in case of connectivity errors.

Associated Configurations

Throws

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Drop Database

<mongo:drop-database>

Drop the current database.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Database Name

String

Name of the database to drop.

x

Reconnection Strategy

Retry strategy in case of connectivity errors.

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Drop Index

<mongo:drop-index>

Drops an existing index.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Name of the collection.

x

Index Name

String

Name of the index to drop.

x

Reconnection Strategy

Retry strategy in case of connectivity errors.

Associated Configurations

Throws

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Dump

<mongo:dump>

Executes a dump of the database to the specified output directory. If no output directory is provided, the default /dump directory is used.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Output Directory

String

Output directory in which dump files are created.

x

Output Name Prefix

String

Output file name prefix. If unspecified, the database name is used.

Oplog

Boolean

Point in time backup (requires an oplog).

false

Operation Timeout

Number

Maximum wait time for the dump.

60

Operation Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Operation Timeout field.

SECONDS

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Array of String

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Execute Command

<mongo:execute-command>

Executes a command on the database.

The Execute Command operation results are not paginated.

If an execution returns a cursor reference, use the getMore command to retrieve the next page of results. Refer to Additional Configuration Information for more details.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Command

Binary

Command to execute on the database as a document.

#[payload]

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Binary

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Find Documents

<mongo:find-documents>

Finds all documents that match a given query. If no query is specified, all documents of the collection are retrieved. If no fields object is specified, all fields are retrieved.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Query

Binary

Query for finding documents. If unspecified, all documents are retrieved. Values can be {"field1": "value1"} or can contain operators {"field1": {$gte: 1, $lt: 10}}.

Sort By

Binary

Indicates the document used to sort the results. Use [{"yourField":"ASC"}] to sort by ascending, or [{"yourField":"DESC"}] to sort by descending.

Page Size

Number

Size of the documents of each page to return.

100

Limit

Number

Limit of the documents to return.

Write Concern Acknowledgement

String

Level of acknowledgment requested from MongoDB for write operations propagated to the specified number of MongoDB instances. You can specify a number of instances, for example, n>0, or use a value from the list.

Write Concern Timeout

Number

Specifies a time limit, in milliseconds, for Write Concern Acknowledgement. The value must be greater than 1.

Write Concern Timeout Timeunit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Write Concern Timeout field.

SECONDS

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Collection Name

String

Collection name.

x

Fields

String

Comma-separated list of fields to return from each document. To return all fields, type a single comma character.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Array of Binary

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Find Files

<mongo:find-files>

Lists all files that match the given query.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Query

Binary

Query for listing all files. Values can be {"field1": "value1"} or can contain operators {"field1": {$gte: 1, $lt: 10}}.

Sort

Binary

Enables you to sort the result list. A file is sorted by file ID or upload date.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Array of Binary

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT-FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Get File Content

<mongo:get-file-content>

Gets an InputStream to the content of the file specified by File Id.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

File Id

Binary

Mandatory file ID.

#[payload]

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Any

Attributes Type

Binary

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Insert Document

<mongo:insert-document>

Inserts a document in a collection. If you do not use the id field to specify an object, MongoDB automatically generates an ID.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Name of the collection in which to insert the given document.

x

Document

Binary

Document to insert.

#[payload]

Write Concern Acknowledgement

String

Level of acknowledgment requested from MongoDB for write operations propagated to the specified number of MongoDB instances. You can specify a number of instances, for example, n>0, or use a value from the list.

Write Concern Timeout

Number

Specifies a time limit, in milliseconds, for Write Concern Acknowledgement. The value must be greater than 1.

Write Concern Timeout Timeunit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Write Concern Timeout field.

SECONDS

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Binary

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Insert Documents

<mongo:insert-documents>

Inserts a document in a collection. If you don’t use the id field to specify an object, MongoDB automatically generates an ID.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Name of the collection in which to insert the given document.

x

Documents

Binary

List of the documents to insert.

#[payload]

Write Ordered

Boolean

Indicates whether the list of documents are executed in order. If set to true and an error occurs during the processing of one of the write operations, MongoDB returns without processing any remaining write operations in the list.

false

Write Concern Acknowledgement

String

Level of acknowledgment requested from MongoDB for write operations propagated to the specified number of MongoDB instances. You can specify a number of instances, for example, n>0, or use a value from the list.

Write Concern Timeout

Number

Specifies a time limit, in milliseconds, for Write Concern Acknowledgement. The value must be greater than 1.

Write Concern Timeout Timeunit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Write Concern Timeout field.

SECONDS

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Bulk Operation Result

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

List Collections

<mongo:list-collections>

Lists names of collections available on this database.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Array of String

Associated Configurations

Throws

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

List Indexes

<mongo:list-indexes>

Lists existent indexes in a collection.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Name of the collection.

x

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Array of Index

Associated Configurations

Throws

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Map Reduce

<mongo:map-reduce>

Transforms a collection into a collection of aggregated groups, as follows:

  1. Applies a supplied element-mapping function to each element, which transforms each element into a key-value pair.

  2. Groups the resulting pairs by key.

  3. Reduces values in each group by applying a supplied 'reduce' function coded in JavaScript.

Refer to the MongoDB documentation for more information.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Name of the collection to map and reduce.

x

Mapping Function

String

JavaScript-encoded mapping function.

x

Reduce Function

String

JavaScript-encoded reducing function.

x

Output Collection

String

Name of the output collection to which to write the results. This replaces an existing collection, if any exists. This field is mandatory if the resulting objects are larger than 16 MB. If Output Collection is unspecified, the computation is performed in-memory and is not persisted.

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Binary

Associated Configurations

Throws

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Remove Documents

<mongo:remove-documents>

Removes all the documents that match the specified query. If a query is not specified, all documents are removed. It is more efficient to drop a connection and re-create it than to use this operation.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Collection for which to remove elements.

x

Query

Binary

Query for detecting the elements to delete. Values can be {"field1": "value1"} or can contain operators {"field1": {$gte: 1, $lt: 10}}.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Number

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Remove Files

<mongo:remove-files>

Removes the file that matches the given file ID. If no file ID is specified, all files are removed.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

File Id

Binary

ID of the file to delete.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Restore From Directory

<mongo:restore-from-directory>

Takes the output from the Dump operation, restores the output, and generates indexes. This operation inserts records only when the IDs do not already exist in the database.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Input Path

String

Input path of the dump files. This path must be a directory.

x

Drop Collections

Boolean

Indicates whether to drop existing collections before performing the restore.

false

Oplog Replay

Boolean

Replay oplog used for point-in-time restore.

false

Reconnection Strategy

Retry strategy in case of connectivity errors.

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Restore From File

<mongo:restore-from-file>

Restores a single .bson file or a zip file.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Name of the collection to restore.

x

Input

Binary

InputStream that points to the dump file. It can be a .bson file or a zip file.

#[payload]

Drop Collection

Boolean

Indicates whether to drop existing collections before performing the restore.

false

Reconnection Strategy

Retry strategy in case of connectivity errors.

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Update Documents

<mongo:update-documents>

Updates documents that match the specified query. If a query is not specified, all documents are retrieved. If the multi parameter is set to false, only the first document matching the query is updated. Otherwise, all documents matching the query are updated.

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Collection Name

String

Name of the collection to update.

x

Query

Binary

Query for detecting the element to update. Values can be {"field1": "value1"} or can contain operators {"field1": {$gte: 1, $lt: 10}}.

Content To Update

Binary

Object to replace the document that matches the query.

#[payload]

Multiple Update

Boolean

Indicates whether only the first document matching the query is updated.

false

Upsert

Boolean

If set to true, creates a new document when no document matches the query criteria. The default value is false, which does not insert a new document when no match is found.

false

Write Concern Acknowledgement

String

Level of acknowledgment requested from MongoDB for write operations propagated to the specified number of MongoDB instances. You can specify a number of instances, for example, n>0, or use a value from the list.

Write Concern Timeout

Number

Specifies a time limit, in milliseconds, for Write Concern Acknowledgement. The value must be greater than 1.

Write Concern Timeout Timeunit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Write Concern Timeout field.

SECONDS

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores the operation’s output.

Target Value

String

Expression that evaluates the operation’s output. The expression outcome is stored in the target variable.

#[payload]

Reconnection Strategy

Retry strategy in case of connectivity errors.

Output

Type

Any

Associated Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Object Types

Bulk Item

Bulk item type.

Field Type Description Default Value Required

Exception

Any

Exception.

Id

Any

ID.

Message

String

Message.

Payload

Binary

Payload.

Status Code

String

Status code.

Successful

Boolean

Indicates success.

Bulk Operation Result

Bulk operation result type.

Field Type Description Default Value Required

Id

Any

ID.

Items

Array of Bulk Item

Array of items.

Successful

Boolean

Indicates success.

Crl File

Specifies the location of the certification revocation list (CRL) file.

Field Type Description Default Value Required

Path

String

Path to the CRL file.

Custom Ocsp Responder

Configures a custom OCSP responder for certification revocation checks.

Field Type Description Default Value Required

Url

String

URL of the OCSP responder.

Cert Alias

String

Alias of the signing certificate for the OCSP response. If specified, the alias must be in the truststore.

Expiration Policy

Configures an expiration policy strategy.

Field Type Description Default Value Required

Max Idle Time

Number

Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

Index

Index type.

Field Type Description Default Value Required

Field Name

String

Field name.

Name

String

Name of the index.

Order

Enumeration, one of:

  • ASC

  • DESC

Order of the index.

Key Store

Configures the keystore for the TLS protocol. The keystore you generate contains a private key and a public certificate.

Field Type Description Default Value Required

Path

String

Path to the keystore. Mule resolves the path relative to the current classpath and file system.

Type

String

Type of keystore.

Alias

String

Alias of the key to use when the keystore contains multiple private keys. By default, Mule uses the first key in the file.

Key Password

String

Password used to protect the private key.

Password

String

Password used to protect the keystore.

Algorithm

String

Encryption algorithm that the keystore uses.

Read Preference Tag

Read preference tag type.

Field Type Description Default Value Required

Name Value

Object

Name value.

x

Reconnect

Configures a standard reconnection strategy, which specifies how often to reconnect and how many reconnection attempts the connector source or operation can make.

Field Type Description Default Value Required

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

Count

Number

How many reconnection attempts the Mule app can make.

Reconnect Forever

Configures a forever reconnection strategy by which the connector source or operation attempts to reconnect at a specified frequency for as long as the Mule app runs.

Field Type Description Default Value Required

Frequency

Number

How often to attempt to reconnect, in milliseconds.

Reconnection

Configures a reconnection strategy for an operation.

Field Type Description Default Value Required

Fails Deployment

Boolean

What to do if, when an app is deployed, a connectivity test does not pass after exhausting the associated reconnection strategy:

  • true

    Allow the deployment to fail.

  • false

    Ignore the results of the connectivity test.

Reconnection Strategy

Reconnection strategy to use.

Redelivery Policy

Configures the redelivery policy for executing requests that generate errors. You can add a redelivery policy to any source in a flow.

Field Type Description Default Value Required

Max Redelivery Count

Number

Maximum number of times that a redelivered request can be processed unsuccessfully before returning a REDELIVERY_EXHAUSTED error.

Message Digest Algorithm

String

Secure hashing algorithm to use if the Use Secure Hash field is true. If the payload of the message is a Java object, Mule ignores this value and returns the value that the payload’s hashCode() returned.

Id Expression

String

One or more expressions that determine if a message is redelivered. This property can be set only if the Use Secure Hash field is false.

Object Store

ObjectStore

Configures the object store that stores the redelivery counter for each message.

Repeatable File Store Iterable

Repeatable file store iterable type.

Field Type Description Default Value Required

In Memory Objects

Number

Maximum amount of instances to keep in memory. If more than that is required, content on the disk is buffered.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the In Memory Size field.

Repeatable File Store Stream

Configures the repeatable file-store streaming strategy by which Mule keeps a portion of the stream content in memory. If the stream content is larger than the configured buffer size, Mule backs up the buffer’s content to disk and then clears the memory.

Field Type Description Default Value Required

In Memory Size

Number

Maximum amount of memory that the stream can use for data. If the amount of memory exceeds this value, Mule buffers the content to disk. To optimize performance:

  • Configure a larger buffer size to avoid the number of times Mule needs to write the buffer on disk. This increases performance, but it also limits the number of concurrent requests your application can process, because it requires additional memory.

  • Configure a smaller buffer size to decrease memory load at the expense of response time.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the In Memory Size field.

Repeatable In Memory Iterable

Repeatable in memory iterable type.

Field Type Description Default Value Required

Initial Buffer Size

Number

Amount of instances to initially keep in memory to consume the stream and provide random access to it. If the stream contains more data than can fit into this buffer, then the buffer expands according to the Buffer Size Increment attribute, with an upper limit of Max In Memory Size. Default value is 100 instances.

Buffer Size Increment

Number

This is by how much the buffer size expands if it exceeds its initial size. Setting a value of 0 or lower means that the buffer must not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised when the buffer gets full. Default value is 100 instances.

Max Buffer Size

Number

Maximum amount of memory to use. If more than that is used, a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised. A value lower than or equal to 0 means no limit.

Repeatable In Memory Stream

Configures the in-memory streaming strategy by which the request fails if the data exceeds the MAX buffer size. Always run performance tests to find the optimal buffer size for your specific use case.

Field Type Description Default Value Required

Initial Buffer Size

Number

Initial amount of memory to allocate to the data stream. If the streamed data exceeds this value, the buffer expands by Buffer Size Increment, with an upper limit of Max In Memory Size value.

Buffer Size Increment

Number

Amount by which the buffer size expands if it exceeds its initial size. Setting a value of 0 or lower specifies that the buffer can’t expand.

Max Buffer Size

Number

The maximum amount of memory to use. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised. A value lower than or equal to zero means no limit.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Unit for the Initial Buffer Size, Buffer Size Increment, and Buffer Unit fields.

Server Address

Server address type.

Field Type Description Default Value Required

Host

String

Host to which you want to connect.

x

Port

Number

Port of the host to which you want to connect.

27017

Standard Revocation Check

Configures standard revocation checks for TLS certificates.

Field Type Description Default Value Required

Only End Entities

Boolean

Which elements to verify in the certificate chain:

  • true

    Verify only the last element in the certificate chain.

  • false

    Verify all elements in the certificate chain.

Prefer Crls

Boolean

How to check certificate validity:

  • true

    Check the Certification Revocation List (CRL) for certificate validity.

  • false

    Use the Online Certificate Status Protocol (OCSP) to check certificate validity.

No Fallback

Boolean

Whether to use the secondary method to check certificate validity:

  • true

    Use the method that wasn’t specified in the Prefer Crls field (the secondary method) to check certificate validity.

  • false

    Do not use the secondary method to check certificate validity.

Soft Fail

Boolean

What to do if the revocation server can’t be reached or is busy:

  • true

    Avoid verification failure.

  • false

    Allow the verification to fail.

Tls

Configures TLS to provide secure communications for the Mule app.

Field Type Description Default Value Required

Enabled Protocols

String

Comma-separated list of protocols enabled for this context.

Enabled Cipher Suites

String

Comma-separated list of cipher suites enabled for this context.

Trust Store

Configures the TLS truststore.

Key Store

Configures the TLS keystore.

Revocation Check

Configures a revocation checking mechanism.

Trust Store

Configures the truststore for TLS.

Field Type Description Default Value Required

Path

String

Path to the truststore. Mule resolves the path relative to the current classpath and file system.

Password

String

Password used to protect the truststore.

Type

String

Type of truststore.

Algorithm

String

Encryption algorithm that the truststore uses.

Insecure

Boolean

If true, Mule stops performing certificate validations. Setting this to true can make connections vulnerable to attacks.

View on GitHub