Skip to content

Commit a5375f5

Browse files
Chris Choschmalliso
authored andcommitted
DOCSP-12730: add exclusion example (#63)
* DOCSP-12730: add exclusion example
1 parent f11d9a8 commit a5375f5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

source/kafka-source.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,18 @@ collections by matching with a regular expression on the collection names:
492492

493493
pipeline=[{"$match": {"ns.coll": {"$regex": /^(collection1|collection2)$/}}}]
494494

495+
You can also set a regular expression to match all collections except for
496+
ones that match specific names. The following sample configuration shows
497+
how you can set your source connector to listen to all collections except
498+
ones in the collection named "customers":
499+
500+
.. code-block:: properties
501+
502+
"pipeline":[{"$match": {"ns.coll": {"$regex": "/^(?!customers\.).*/"}}}]
503+
504+
For more information on how to build regular expressions, see the
505+
`Java SE documentation on Patterns <https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html>`__.
506+
495507
.. _topic-naming-example:
496508

497509
Topic Naming Example

0 commit comments

Comments
 (0)