Kafka connector stuck with MongoDB Change Stream error

  1. you can modify change stream output using pipeline.
    see:https://www.mongodb.com/docs/v5.2/changeStreams/#modify-change-stream-output
    for example, using $unset to remove unused fields (eg: updateDescription).
    if using debezium, You can modify the configuration item cursor.pipeline. see: Debezium connector for MongoDB :: Debezium Documentation

  2. set cursor.oversize.handling.mode to split mode to split stream event to multiple events
    Change events exceeding the maximum BSON size will be split using the $changeStreamSplitLargeEvent aggregation. This option requires MongoDB 6.0.9 or newer .