anchor.diff:  === Example configuration
   
   To use the connector to produce change events for a particular MongoDB replica set or sharded cluster, create a configuration file in JSON.
  -When the connector starts, it will perform an initial sync of the collections in your MongoDB replica sets and start reading the replica sets' oplogs, producing events for every inserted, updated, and deleted row.
  +When the connector starts, it will perform a snapshot of the collections in your MongoDB replica sets and start reading the replica sets' oplogs, producing events for every inserted, updated, and deleted row.
   Optionally filter out collections that are not needed.
   
   Here is an example of the configuration for a MongoDB connector that monitors a MongoDB replica set `rs0` at port 27017 on 192.168.99.100, which we logically name `fullfillment`:
  
positive.code: 
  If we look at the `schema` portion of this event's _value_, we can see the schema for the _envelope_ is specific to the collection, and the schema for the `source` structure (which is specific to the MongoDB connector and reused across all events). Also note that the `after` value is always a string, and that by convention it will contain a JSON representation of the document.
  
  If we look at the `payload` portion of this event's _value_, we can see the information in the event, namely that it is describing that the document was read as part of an initial sync (since `op=r` and `initsync=true`), and that the `after` field value contains the JSON string representation of the document.
  
  [NOTE]
  ====
  
negative.code: 
  See the link:#mongodb-connector-properties[complete list of connector properties] that can be specified in these configurations.
  
  This configuration can be sent via POST to a running Kafka Connect service, which will then record the configuration and start up the one connector task that will connect to the MongoDB replica set or sharded cluster, assign tasks for each replica set, perform a snapshot if necessary, read the oplog, and record events to Kafka topics.
  
  [[mongodb-connector-monitoring]]
  === Monitoring
  
  Kafka, Zookeeper, and Kafka Connect all have built-in support for JMX metrics.
  The MongoDB connector also publishes a number of metrics about the connector's activities that can be monitored through JMX.
  The connector has two types of metrics.
  Snapshot metrics help you monitor the snapshot activity and are available when the connector is performing a snapshot.
  Streaming metrics help you monitor the progress and activity while the connector reads CDC collection changes.
  
  [[monitoring-snapshots]]
  [[snapshot-metrics]]
  ==== Snapshot Metrics
  
  ===== *MBean: debezium.mongodb:type=connector-metrics,context=snapshot,server=_<mongodb.name>_*
  
  [cols="30%a,10%a,60%a",options="header"]
  |=======================
  |Attribute Name
  |Type
  |Description
  
  |`LastEvent`
  |`string`
  |The last snapshot event that the connector has read.
  
  |`MilliSecondsSinceLastEvent`
  |`long`
  |The number of milliseconds since the connector has read and processed the most recent event.
  
  |`TotalNumberOfEventsSeen`
  |`long`
  |The total number of events that this connector has seen since last started or reset.
  
  |`NumberOfEventsFiltered`
  |`long`
  |The number of events that have been filtered by whitelist or blacklist filtering rules configured on the connector.
  
  |`MonitoredTables`
  |`string[]`
  |The list of collections that are monitored by the connector.
  
  |`QueueTotalCapcity`
  |`int`
  |The length of the queue used to pass events between the snapshotter and the main Kafka Connect loop.
  
  |`QueueRemainingCapcity`
  |`int`
  |The free capacity of the queue used to pass events between the snapshotter and the main Kafka Connect loop.
  
  |`TotalTableCount`
  |`int`
  |The total number of collections that are being included in the snapshot.
  
  |`RemainingTableCount`
  |`int`
  |The number of collections that the snapshot has yet to copy.
  
  |`SnapshotRunning`
  |`boolean`
  |Whether the snapshot was started.
  
  |`SnapshotAborted`
  |`boolean`
  |Whether the snapshot was aborted.
  
  |`SnapshotCompleted`
  |`boolean`
  |Whether the snapshot completed.
  
  |`SnapshotDurationInSeconds`
  |`long`
  |The total number of seconds that the snapshot has taken so far, even if not complete.
  
  |`RowsScanned`
  |`Map<String, Long>`
  |Map containing the number of documents exported for each collection in the snapshot. Collections are incrementally added to the Map during processing. Updates every 10,000 documents scanned and upon completing a collection.
  
  |=======================
  
  
  [[monitoring-streaming]]
  [[streaming-metrics]]
  ==== Streaming Metrics
  
  ===== *MBean: debezium.sql_server:type=connector-metrics,context=streaming,server=_<mongodb.name>_*
  
  [cols="30%a,10%a,60%a",options="header"]
  |=======================
  |Attribute Name
  |Type
  |Description
  
  |`LastEvent`
  |`string`
  |The last streaming event that the connector has read.
  
  |`MilliSecondsSinceLastEvent`
  |`long`
  |The number of milliseconds since the connector has read and processed the most recent event.
  
  |`TotalNumberOfEventsSeen`
  |`long`
  |The total number of events that this connector has seen since last started or reset.
  
  |`NumberOfEventsFiltered`
  |`long`
  |The number of events that have been filtered by whitelist or blacklist filtering rules configured on the connector.
  
  |`MonitoredTables`
  |`string[]`
  |The list of collections that are monitored by the connector.
  
  |`QueueTotalCapcity`
  |`int`
  |The length of the queue used to pass events between the streamer and the main Kafka Connect loop.
  
  |`QueueRemainingCapcity`
  |`int`
  |The free capacity of the queue used to pass events between the streamer and the main Kafka Connect loop.
  
  |`Connected`
  |`boolean`
  |Flag that denotes whether the connector is currently connected to mongodb.
  
  |`MilliSecondsBehindSource`
  |`long`
  |The number of milliseconds between the last change event's timestamp and the connector processing it. The values will incorporate any differences between the clocks on the machines where the database server and the connector are running.
  
  |`NumberOfCommittedTransactions`
  |`long`
  |The number of processed transactions that were committed.
  
  |`SourceEventPosition`
  |`map<string, string>`
  |The coordinates of the last received event.
  
  |`LastTransactionId`
  |`string`
  |Transaction identifier of the last processed transaction.
  
  |=======================
  
  [[mongodb-connector-properties]]
  === Connector properties
  