-
Type:
Question
-
Resolution: Gone away
-
Priority:
Major - P3
-
None
-
Affects Version/s: 1.9.1
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Original title: 通过连接器获取的数据,是带有“ and \ 和转义符号的无法解析的json字符串,而不是json.tostring()所获取的jsonString
This is the description of the source connection:
{"connector.class":"com.mongodb.kafka.connect.MongoSourceConnector",
"mongo.errors.deadletterqueue.topic.name":"conn_error_data",
"publish.full.document.only":"false",
" mongo.errors.log.enable":"true",
"startup.mode":"copy_existing",
"tasks.max":"2",
"change.stream.full.document":"updateLookup",
"collection" :"",
"mongo.errors.tolerance":"all",
"database":"****",
"topic.prefix":"mongo-cdc1",
"topic.separator":"_",
" connection.uri":"mongodb://user:pass@mongo1:27017,mongo2:27017,mongo3:27017" ,
“姓名”:"mongo-cdc-chatbot"}
以下是获取的数据: (The following is the data obtained )
“{\“_ID\”: {\"_data\": \"8263EA11F300000A002B022C0100296E5A10044626960F9B9E4F8A8CCB5B7FB645F88746645F6964006463E30D187FA0165B25002E010004\"}
, \"operationType\": \"delete\", \"clusterTime\": \{\"$timestamp\": {\"t\": 1676284403, \"i\": 2560}}, \"ns\ ": \{\"db\": \"chatbot\", \"coll\": \"test\"}, \"documentKey\": {\"_id\":
{\"$oid\": \"63e30d187fa0165b25002e01\"}}}"
When parsing:
通过BSONDocumeng.parse(str)解析是出现的错误: readStartDocument 只能在 CurrentBSONType 为 DOCUMENT 时调用,不能在 CurrentBSONType 为 STRING 时调用。