Overview
Puedes establecer propiedades de configuración para especificar cómo el conector sink de Kafka de MongoDB escribe datos en MongoDB. Las siguientes secciones describen las propiedades de configuración que se pueden configurar para personalizar este comportamiento.
Modelo de guardar
Configura la writemodel.strategy propiedad de configuración para especificar cómo el conector de sumidero escribe datos cuando recibe un registro de sumidero.
Puedes establecer el valor de writemodel.strategy en cualquiera de los nombres de clase totalmente cualificados de las estrategias del modelo de guardar descritas en el Estrategias sección de esta página. Puedes especificar una estrategia configurando lo siguiente:
writemodel.strategy=<a write model strategy>
Eliminar modelo guardar
Establece la propiedad de configuración delete.writemodel.strategy para especificar cómo el conector del destino escribe datos al recibir un evento tombstone. Un evento tombstone es un registro que contiene una clave pero sin valor, lo que indica un registro borrado.
Puede establecer el valor de delete.writemodel.strategy en cualquiera de los nombres de clase totalmente calificados de las estrategias del modelo de guardado descritas en la sección Estrategias de esta página. Puede especificar una estrategia configurando lo siguiente:
delete.writemodel.strategy=<a write model strategy>
Para una lista de configuraciones de conectores de salida organizadas por categoría, consulte la guía sobre Propiedades de configuración del Connector de destino.
Strategies
Nombre | Descripción | |
|---|---|---|
DefaultWriteModelStrategy | Description: This strategy uses the ReplaceOneDefaultStrategy by
default, and the InsertOneDefaultStrategy if you set the
timeseries.timefield option.This is the default value value for the writemodel.strategy
configuration property. | |
InsertOneDefaultStrategy | Description: Insert each sink record into MongoDB as a document. To specify this strategy, set the configuration property to the
following class name: | |
ReplaceOneDefaultStrategy | Description: Replaces at most one document in MongoDB that matches a sink
record by the _id field. If no documents match, the
connector inserts the sink record as a new document.To specify this strategy, set the configuration property to the
following class name: | |
ReplaceOneBusinessKeyStrategy | Description: Replaces at most one document that matches a sink record by a
specified business key. If no documents match, the
connector inserts the sink record as a new document. To specify this strategy, set the configuration property to the
following class name: To see an example showing how to use this strategy, see our
guide on write model strategies. | |
DeleteOneDefaultStrategy | Description: Deletes at most one document that matches your sink connector's
key structure by the _id field only when the document
contains a null value structure.This is the default value for the
delete.writemodel.strategy configuration property.This strategy is set as the default value of the
writemodel.strategy property when you set
delete.on.null.values=true.To specify this strategy, set the configuration property to the
following class name: | |
DeleteOneBusinessKeyStrategy | Description: Deletes at most one MongoDB document that matches a sink record by a business key. To specify this strategy, set the configuration property to the
following class name: To see an example showing how to use this strategy, see our
guide on write model strategies. | |
UpdateOneDefaultStrategy | Description: Updates at most one document in MongoDB that matches a sink
record by the _id field. If no documents match, the
connector inserts the sink record as a new document.To specify this strategy, set the configuration property to the
following class name: | |
UpdateOneTimestampsStrategy | Description: Add _insertedTS (inserted timestamp) and _modifiedTS (modified timestamp) fields into documents.To specify this strategy, set the configuration property to the
following class name: To see an example showing how to use this strategy, see our
guide on write model strategies. | |
UpdateOneBusinessKeyTimestampStrategy | Description: Add _insertedTS (inserted timestamp) and _modifiedTS
(modified timestamp) fields into documents that match a business
key.To specify this strategy, set the configuration property to the
following class name: |