Define the CRUD Operation
To write to MongoDB, ensure that the CRUD operation record header attribute is defined for each record earlier in the pipeline. Records without an operation record header attribute are sent to error.
To update and replace records, you must specify a unique key field. You can also enable upserts for update and replace records.
Note that when performing a DELETE operation, the destination deletes a maximum of one matching document in MongoDB. It does not delete all matching documents, as is sometimes possible with MongoDB.
To write records to MongoDB, make sure records include the following CRUD operation
record header attribute:
- sdc.operation.type
- When defined, the MongoDB destination uses the CRUD operation in the
sdc.operation.type record header attribute when writing to MongoDB. The
MongoDB destination supports the following values for the sdc.operation.type
attribute:
- 1 for INSERT
- 2 for DELETE
- 3 for UPDATE
- 7 for REPLACE