Hi Chrish,
Thanks a lot for the response, I was stuck on this problem statement for a while. I did went through the document. In documentation, debezium team and you have also mentioned that deletion event can only be capture in oplog mode.
- So thats mean I cannot capture deletion event in change-stream-mode ?
- "If you want to identify which document was deleted, you'll need to refer to the Kafka event's key", can you please give any reference link for this?
Also, I am getting null value in filter key also , below is my sample json of debezium output
----------------------------------------------------------------------------------------------------------------------------------------------------------------
{
"schema": {
"type": "struct",
"fields": [
{
"type": "string",
"optional": true,
"name": "io.debezium.data.Json",
"version": 1,
"field": "after"
},
{
"type": "string",
"optional": true,
"name": "io.debezium.data.Json",
"version": 1,
"field": "patch"
},
{
"type": "string",
"optional": true,
"name": "io.debezium.data.Json",
"version": 1,
"field": "filter"
},
{
"type": "struct",
"fields": [
{
"type": "array",
"items": {
"type": "string",
"optional": false
},
"optional": true,
"field": "removedFields"
},
{
"type": "string",
"optional": true,
"name": "io.debezium.data.Json",
"version": 1,
"field": "updatedFields"
},
{
"type": "array",
"items": {
"type": "struct",
"fields": [
{
"type": "string",
"optional": false,
"field": "field"
},
{
"type": "int32",
"optional": false,
"field": "size"
}
],
"optional": false,
"name": "io.debezium.connector.mongodb.changestream.truncatedarray"
},
"optional": true,
"field": "truncatedArrays"
}
],
"optional": true,
"name": "io.debezium.connector.mongodb.changestream.updatedescription",
"field": "updateDescription"
},
{
"type": "struct",
"fields": [
{
"type": "string",
"optional": false,
"field": "version"
},
{
"type": "string",
"optional": false,
"field": "connector"
},
{
"type": "string",
"optional": false,
"field": "name"
},
{
"type": "int64",
"optional": false,
"field": "ts_ms"
},
{
"type": "string",
"optional": true,
"name": "io.debezium.data.Enum",
"version": 1,
"parameters": {
"allowed": "true,last,false,incremental"
},
"default": "false",
"field": "snapshot"
},
{
"type": "string",
"optional": false,
"field": "db"
},
{
"type": "string",
"optional": true,
"field": "sequence"
},
{
"type": "string",
"optional": false,
"field": "rs"
},
{
"type": "string",
"optional": false,
"field": "collection"
},
{
"type": "int32",
"optional": false,
"field": "ord"
},
{
"type": "int64",
"optional": true,
"field": "h"
},
{
"type": "int64",
"optional": true,
"field": "tord"
},
{
"type": "string",
"optional": true,
"field": "stxnid"
},
{
"type": "string",
"optional": true,
"field": "lsid"
},
{
"type": "int64",
"optional": true,
"field": "txnNumber"
}
],
"optional": false,
"name": "io.debezium.connector.mongo.Source",
"field": "source"
},
{
"type": "string",
"optional": true,
"field": "op"
},
{
"type": "int64",
"optional": true,
"field": "ts_ms"
},
{
"type": "struct",
"fields": [
{
"type": "string",
"optional": false,
"field": "id"
},
{
"type": "int64",
"optional": false,
"field": "total_order"
},
{
"type": "int64",
"optional": false,
"field": "data_collection_order"
}
],
"optional": true,
"field": "transaction"
}
],
"optional": false,
"name": "Mongo.test.business.Envelope"
},
"payload": {
"after": null,
"patch": null,
"filter": null,
"updateDescription": null,
"source": {
"version": "1.8.1.Final",
"connector": "mongodb",
"name": "Mongo",
"ts_ms": 1651209022000,
"snapshot": "false",
"db": "test",
"sequence": null,
"rs": "docker-rs",
"collection": "business",
"ord": 1,
"h": null,
"tord": null,
"stxnid": null,
"lsid": null,
"txnNumber": null
},
"op": "d",
"ts_ms": 1651209022792,
"transaction": null
}
}
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Again, thanks a lot for the response, looking forward to hear from you :)
Regards
Akshay