This is an automated email from the ASF dual-hosted git repository. dmvolod pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit f646e9aec57370a87ef1379eafd8a39df8f958f5 Author: Dmitry Volodin <dmvo...@gmail.com> AuthorDate: Fri Apr 10 09:58:47 2020 +0300 CAMEL-14872: place doc in correct file --- .../camel-mongodb/src/main/docs/mongodb-component.adoc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/components/camel-mongodb/src/main/docs/mongodb-component.adoc b/components/camel-mongodb/src/main/docs/mongodb-component.adoc index d8a2736..19d70c7 100644 --- a/components/camel-mongodb/src/main/docs/mongodb-component.adoc +++ b/components/camel-mongodb/src/main/docs/mongodb-component.adoc @@ -966,6 +966,7 @@ from("mongodb:myDb?database=flights&collection=cancellations&tailTrackIncreasing Change Streams allow applications to access real-time data changes without the complexity and risk of tailing the MongoDB oplog. Applications can use change streams to subscribe to all data changes on a collection and immediately react to them. Because change streams use the aggregation framework, applications can also filter for specific changes or transform the notifications at will. +The exchange body will contain the full document of any change. To configure Change Streams Consumer you need to specify `consumerType`, `database`, `collection` and optional JSON property `streamFilter` to filter events. @@ -988,7 +989,21 @@ Java configuration: from("mongodb:myDb?consumerType=changeStreams&database=flights&collection=tickets") .routeProperty("streamFilter", "{'$match':{'$or':[{'fullDocument.stringValue': 'specificValue'}]}}") .to("mock:test"); + ------------- +The `changeStreams` consumer type will also return the following OUT headers: + +[width="100%",cols="10%,10%,60%,20%",options="header",] +|======================================================================= +|Header key |Quick constant |Description (extracted from MongoDB API doc) |Data type + +|`CamelMongoDbStreamOperationType` |`MongoDbConstants.STREAM_OPERATION_TYPE` | The type of operation that occurred. Can +be any of the following values: insert, delete, replace, update, drop, rename, dropDatabase, invalidate. |String + +|`_id` |`MongoDbConstants.MONGO_ID` |A document that contains the _id of the document created or modified by the insert, +replace, delete, update operations (i.e. CRUD operations). For sharded collections, also displays the full shard key for +the document. The _id field is not repeated if it is already a part of the shard key. |ObjectId +|======================================================================= == Type conversions