Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Kafka Connector
Created by Guest
Created on Feb 16, 2025

Built-in Partial Update $push Strategy for MongoDB Kafka Connector

We would like the official MongoDB Kafka Connector to natively support partial updates that append (\$push) records into an array in an upsert scenario—specifically, a built-in WriteModelStrategy to handle use cases where: We match on a configurable business key (instead of _id) to avoid duplicate documents. If no document exists, we create one (upsert) with a newly initialized array. We append (push) each incoming Kafka record to the array on subsequent updates. We optionally maintain createdTS and modifiedTS timestamps. This is a common pattern for applications that want to store event logs or historic states in array fields, or otherwise need to accumulate messages over time within a single MongoDB document.