Skip to content

MongoDB

Reads documents from a MongoDB collection, converting BSON to JSON.

Configuration

yaml
source:
  kind: mongodb
  connection_string: "mongodb://localhost:27017"
  database: mydb
  collection: events
FieldDefaultDescription
connection_string(required)MongoDB connection URI
database(required)Database name
collection(required)Collection name
filterOptional JSON filter document
batch_size_rowsRows per batch

Namespace: mongodb.{database}.{collection}

CLI

bash
skippr connect source mongodb \
  --connection-string 'mongodb://user:pass@host:27017' \
  --database mydb \
  --collection users
FlagDescription
--connection-stringMongoDB connection URI
--databaseDatabase name
--collectionCollection name
--filterOptional JSON filter document

CDC

MongoDB supports real-time Change Data Capture via change streams. Add cdc_enabled: true to the source config and configure a pipeline cdc: block.

See CDC Sources -- MongoDB for prerequisites, configuration, and resume behavior.