Docs Menu

Copy Existing Properties

On this page

  • Overview
  • Settings

Use the following configuration settings to enable the copy existing feature which converts MongoDB collections into Change Stream events.

See also:

For an example of the copy existing feature, see the Copy Existing Data Usage Example.

For a list of source connector configuration settings organized by category, see the guide on Source Connector Configuration Properties.

Type: boolean

Whether to enable the copy existing feature which converts all data in a MongoDB collection to Change Stream events and publishes them on Kafka topics. If MongoDB changes the source collection data after the connector starts the copy process, the connector creates events for the changes after it completes the copy process.
Accepted Values: true or false
Type: string

Regular expression the connector uses to match namespaces from which to copy data. A namespace describes the MongoDB database name and collection separated by a period, e.g. databaseName.collectionName.

In the following example, the regular expression setting matches collections that start with "page" in the "stats" database.


The "\" character in the example above escapes the "." character that follows it in the regular expression. For more information on how to build regular expressions, see the Java API documentation on Patterns.

Default: ""
Accepted Values: A valid regular expression
Type: string

An array of pipeline operations the connector runs when copying existing data. You can use this setting to filter the source collection and improve the use of indexes in the copying process.

The following example shows how you can use the $match aggregation operator to instruct the connector to copy only documents that contain a closed field with a value of false.

copy.existing.pipeline=[ { "$match": { "closed": "false" } } ]
Default: []
Accepted Values: Valid aggregation pipeline stages
Type: int

The maximum number of threads the connector can use to copy data.
Default: number of processors available in the environment
Accepted Values: An integer
Type: int

The size of the queue the connector can use when copying data.
Default: 16000
Accepted Values: An integer

On this page

Give Feedback
MongoDB logo
© 2021 MongoDB, Inc.


  • Careers
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2021 MongoDB, Inc.