MongoDB
This page details how to set up MongoDB change stream.
The MongoDB change stream works similar to Cinchy's Change Data Capture functionality. The listener subscribes to monitor the change stream of a specific collection in the database of the MongoDB server. Any actions performed on document(s) inside of that collection are picked up by the listener and sent to the queue.
In order to use change streams in MongoDB, there are a few requirements your environment must meet.
The following parameters should be included in your listener configuration entry when setting up a real time sync using MongoDB.
Parameter | Value |
---|---|
Database | |
Collection | |
Pipeline Stages | Optional. This parameter allows you to specify pipeline stages with filters.
|
{
"database": "cinchy",
"collection": "employee",
"changeStreamSettings": {
"pipelineStages": [
"{ $match: {
$or: [
{ $and: [
{ 'fullDocument.id': { $gt: 0, $lt: 10000 } },
{ 'fullDocument.location': 'Montreal' } ]
},
{ 'operationType': 'delete' }
]
} }"
]
}
}
Parameter | Value |
---|---|
Connection String |
{
"connectionString": "mongodb://localhost:9877"
}
Last modified 3mo ago