Contact Us 1-800-596-4880

MongoDB Connector 6.2 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.

Configurations


Config

Parameters

Name Type Description Default Value Required

Name

String

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

x

Connection

The connection types to provide to 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 can be before the client stops using it 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.

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration. This does not mean that the platform expires the instance at the exact moment that it becomes eligible. Mule purges the instances as appropriate.

Write Concern Acknowledgment

String

The 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 the 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

SECONDS

Connection Types

Connection
Parameters
Name Type Description Default Value Required

Servers (host:port)

Array of Server Address

The server where your MongoDB instance is located. You can specify multiple servers.

x

Database

String

Specify the database name to which you want to connect.

x

Username

String

The username to use for authentication.

Password

String

The password to use for authentication. If you don’t want to use authentication, the password and username must both be empty.

Replica Set Name

String

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

Authentication Source

String

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

An 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 the highest. Higher compression levels take more time to process than lower ones.

-1

Connection Timeout

Number

The connection timeout for establishing socket connections. Set this field to 0 if you don’t want the connection to time out.

30

Connection Timeout Timeunit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

The connection timeout unit.

SECONDS

Local Threshold

Number

The 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

The local threshold time unit.

MILLISECONDS

Server Selection Timeout

Number

Specifies 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

The server selection time unit.

SECONDS

Socket Timeout

Number

The socket timeout. It is used for I/O socket read and write operations. The default is 0. Leave this field as 0 if you don’t want socket read and write operations to time out.

Socket Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

The socket timeout unit.

SECONDS

Retry Writes

Boolean

Enable retryable writes

false

Authentication Mechanism

Enumeration, one of:

  • PLAIN

  • SCRAM_SHA_1

  • SCRAM_SHA_256

The authentication mechanism used for this connection

Tls Context

Tls

Min Connection Pool Size

Number

The minimum size for the connection pool.

Max Connection Pool Size

Number

The maximum size for the connection pool.

100

Max Wait Queue Time

Number

The maximum wait queue time for the connection pool.

120

Max Wait Queue Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

The maximum wait queue time unit for the connection pool.

SECONDS

Max Connection Life Time

Number

The maximum connection lifetime for the connection pool.

Max Connection Life Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

The maximum connection lifetime time unit for the connection pool.

SECONDS

Max Connection Idle Time

Number

The maximum connection idle time for the connection pool.

Max Connection Idle Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

The maximum connection idle time time unit for the connection pool.

SECONDS

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Sources

On Object Listener

<mongo:object-listener>

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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Collection Name

String

The collection that will be watched to detect the matching documents.

x

Watermark Field

String

The field that will queried to detect the objects that match the trigger condition.

x

Primary Node Only

Boolean

Indicates whether this source should be executed only on the primary node when running in a cluster

Scheduling Strategy

scheduling-strategy

Configures the scheduler that triggers the polling

x

Streaming Strategy

Configures the streaming strategy for messages

Redelivery Policy

Defines a policy for processing the redelivery of the same message

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Binary

For Configurations

Operations

Add User

<mongo:add-user>

Adds a new user for this database

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Username

String

Name of the user

x

Password

String

Password to use for authentication

x

Reconnection Strategy

A retry strategy in case of connectivity errors

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use

x

Collection Name

String

The name of the collection

x

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Boolean

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Collection Name

String

The target collection

x

Query

Binary

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

Write Concern Acknowledgement

String

The 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 the 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

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Number

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Collection Name

String

The name of the collection to create

x

Max Objects

Number

The maximum number of documents the new collection is able to contain

Collection Size

Number

The maximum size of the new collection

Collection Size Data Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

Data Unit of the Collection Size parameter, in bytes by default

BYTE

Reconnection Strategy

A retry strategy in case of connectivity errors

For 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, filename, contentType, and extraData.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Content

Binary

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

#[payload]

x

Filename

String

The name of new file

x

Metadata

Binary

A JSON object that holds information to store.

Streaming Strategy

Configures the streaming strategy for messages

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Binary

For 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

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use

x

Collection Name

String

The name of the collection where the index will be created

x

Field Name

String

The name of the field that is indexed

x

Sort Order

Enumeration, one of:

  • ASC

  • DESC

The indexing order

ASC

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

String

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Collection Name

String

The name of the collection to drop

x

Reconnection Strategy

A retry strategy in case of connectivity errors

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Database Name

String

The name of the database to drop.

x

Reconnection Strategy

A retry strategy in case of connectivity errors

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Collection Name

String

The name of the collection

x

Index Name

String

The name of the index to drop

x

Reconnection Strategy

A retry strategy in case of connectivity errors

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Output Directory

String

Output directory where dump files will be created

x

Output Name Prefix

String

Output file name prefix. If not specified, 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 maximum wait time for the dump

SECONDS

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Array of String

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Command

Binary

The command to execute on the database as a Document.

#[payload]

Streaming Strategy

Configures the streaming strategy for messages

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Binary

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Query

Binary

The optional 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

Enables you to sort the result list. A file can be sorted only by file_id or uploadDate.

Page Size

Number

Size of documents of each page to return

100

Limit

Number

Limit of documents to return.

Write Concern Acknowledgement

String

The 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 the 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

Streaming Strategy

Configures the streaming strategy for messages

Collection Name

String

x

Fields

String

Comma-separated list of fields to return from each document. To retrieve all fields in a document, set this value to ,.

x

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Array of Binary

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Query

Binary

The query object used to list 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 can be sorted only by file_id or uploadDate.

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Array of Binary

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

File Id

Binary

The mandatory file ID.

#[payload]

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Any

Attributes Type

Binary

For 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>

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

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Collection Name

String

The name of the collection in which to insert the given document

x

Document

Binary

The document to insert

#[payload]

Write Concern Acknowledgement

String

The 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 the 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

Streaming Strategy

Configures the streaming strategy for messages

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Binary

For 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>

Insert a document in a collection. If you don’t use the _id field to specify an object, MongoDB automatically generates one.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Collection Name

String

The name of the collection in which to insert the given document.

x

Documents

Binary

The list of the documents to insert.

#[payload]

Write Ordered

Boolean

Indicates if the list of documents will be 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

The 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 the 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

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Bulk Operation Result

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Array of String

For 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>

List existent indexes in a collection

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Collection Name

String

The name of the collection

x

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Array of Index

For 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: . Applies a supplied element-mapping function to each element, which transforms each element into a key-value pair . Groups the resulting pairs by key . Reduces values in each group by applying a supplied 'reduce' function coded in JavaScript

Refer to the MongoDB documentation for more information.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use

x

Collection Name

String

The name of the collection to map and reduce

x

Mapping Function

String

A JavaScript-encoded mapping function

x

Reduce Function

String

A JavaScript-encoded reducing function

x

Output Collection

String

The 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 16MB. If Output Collection is unspecified, the computation is performed in-memory and is not persisted.

Streaming Strategy

Configures the streaming strategy for messages

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Binary

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Collection Name

String

The collection for which to remove elements

x

Query

Binary

The query object used to detect the elements to delete. It can be: {"field1": "value1"} Or contain operators: { "field1": { $gte: 1, $lt: 10 } }

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Number

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

File Id

Binary

The ID of the file to be deleted.

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

For 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 it, and generates indexes. The operation only inserts records when the IDs don’t already exist in the database.

Parameters

Name Type Description Default Value Required

Configuration

String

The 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

A retry strategy in case of connectivity errors

For 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 zip file.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Collection Name

String

The name of the collection to restore

x

Input

Binary

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

#[payload]

Drop Collection

Boolean

Indicates whether to drop existing collections before performing restore

false

Reconnection Strategy

A retry strategy in case of connectivity errors

For 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.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x

Collection Name

String

The name of the collection to update

x

Query

Binary

The query object used to detect the element to update. The value can be: {"field1": "value1"}, or it can contain operators { "field1": { $gte: 1, $lt: 10 } }.

Content To Update

Binary

The object to replace the one 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

The 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 the 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

Streaming Strategy

Configures the streaming strategy for messages

Target Variable

String

The name of a variable in which to store the operation’s output

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable

#[payload]

Reconnection Strategy

A retry strategy in case of connectivity errors

Output

Type

Any

For Configurations

Throws

  • MONGO:DUPLICATE_ERROR

  • MONGO:CONSISTENCY_ERROR

  • MONGO:RETRY_EXHAUSTED

  • MONGO:NOT_FOUND

  • MONGO:PERMISSIONS_DENIED

  • MONGO:TIMEOUT

  • MONGO:INVALID_INPUT

  • MONGO:CONNECTIVITY

Types

Server Address

Field Type Description Default Value Required

Host

String

The host to which you want to connect.

x

Port

Number

The port of the host to which you want to connect.

27017

Tls

Field Type Description Default Value Required

Enabled Protocols

String

A comma-separated list of protocols enabled for this context.

Enabled Cipher Suites

String

A comma-separated list of cipher suites enabled for this context.

Trust Store

Key Store

Revocation Check

Trust Store

Field Type Description Default Value Required

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the trust store.

Password

String

The password used to protect the trust store.

Type

String

The type of store used.

Algorithm

String

The algorithm used by the trust store.

Insecure

Boolean

If true, no certificate validations are performed, which makes connections vulnerable to attacks. Use this value at your own risk.

Key Store

Field Type Description Default Value Required

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the key store.

Type

String

The type of store used.

Alias

String

When the key store contains many private keys, this attribute indicates the alias of the key that should be used. If not defined, the first key in the file is used by default.

Key Password

String

The password used to protect the private key.

Password

String

The password used to protect the key store.

Algorithm

String

The algorithm used by the key store.

Standard Revocation Check

Field Type Description Default Value Required

Only End Entities

Boolean

Only verify the last element of the certificate chain.

Prefer Crls

Boolean

Try CRL instead of OCSP first.

No Fallback

Boolean

Do not use the secondary checking method (the one not selected before).

Soft Fail

Boolean

Avoid verification failure when the revocation server can not be reached or is busy.

Custom Ocsp Responder

Field Type Description Default Value Required

Url

String

The URL of the OCSP responder.

Cert Alias

String

Alias of the signing certificate for the OCSP response (must be in the trust store), if present.

Crl File

Field Type Description Default Value Required

Path

String

The path to the CRL file.

Reconnection

Field Type Description Default Value Required

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

The reconnection strategy to use.

Reconnect

Field Type Description Default Value Required

Frequency

Number

How often in milliseconds to reconnect

Count

Number

How many reconnection attempts to make

Reconnect Forever

Field Type Description Default Value Required

Frequency

Number

How often in milliseconds to reconnect

Read Preference Tag

Field Type Description Default Value Required

Name Value

Object

x

Expiration Policy

Field Type Description Default Value Required

Max Idle Time

Number

A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A time unit that qualifies the maxIdleTime attribute

Repeatable In Memory Stream

When streaming in this mode, Mule does not use the disk to buffer the contents. If you exceed the buffer size, the message fails.

Field Type Description Default Value Required

Initial Buffer Size

Number

The amount of memory allocated to consume the stream and provide random access to it. If the stream contains more data than can fit into this buffer, the buffer expands according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize.

Buffer Size Increment

Number

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

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

The unit in which all these attributes are expressed

Repeatable File Store Stream

File store repeatable streams require buffering, and there are different buffering strategies. Mule keeps a portion of contents in memory. If the stream contents are 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

Defines the maximum memory that the stream should use to keep data in memory. If more than that is consumed, the content on the disk is buffered.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

The unit in which maxInMemorySize is expressed

Non-repeatable Stream

In some cases, you may want to disable the repeatable stream functionality and use non-repeatable streams, which can have less performance overhead, memory use, and cost.

Field Type Description Default Value Required

Transactional Action

Enumeration, one of:

  • ALWAYS_JOIN

  • JOIN_IF_POSSIBLE

  • NOT_SUPPORTED

The type of joining action that operations can use for transactions

JOIN_IF_POSSIBLE

Redelivery Policy

Field Type Description Default Value Required

Max Redelivery Count

Number

The maximum number of times a message can be redelivered and processed unsuccessfully before triggering a process-failed-message

Use Secure Hash

Boolean

Whether to use a secure hash algorithm to identify a redelivered message.

Message Digest Algorithm

String

The secure hashing algorithm to use.

SHA-256

Id Expression

String

Defines one or more expressions to use to determine when a message has been redelivered. This property can be set only if useSecureHash is false.

Object Store

Object Store

The object store where the redelivery counter for each message is stored.

Repeatable In Memory Iterable

Field Type Description Default Value Required

Initial Buffer Size

Number

The number 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 bufferSizeIncrement attribute, with an upper limit of maxInMemorySize. 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 zero or lower means that the buffer should 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

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.

Repeatable File Store Iterable

Field Type Description Default Value Required

In Memory Objects

Number

The 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

The unit in which maxInMemorySize is expressed

Bulk Operation Result

Field Type Description Default Value Required

Id

Any

Items

Array of Bulk Item

Successful

Boolean

Bulk Item

Field Type Description Default Value Required

Exception

Any

Id

Any

Message

String

Payload

Binary

Status Code

String

Successful

Boolean

Index

Field Type Description Default Value Required

Field Name

String

Name

String

Order

Enumeration, one of:

  • ASC

  • DESC

View on GitHub