INSERT INTO default VALUES ("abc", { "docId": "abc", "docType": "test", "message": "yes" }),
("abc-def",{ "docId": "abc-def", "docType": "test2", "chat":{ "docId" : "abc" } });
UPDATE default AS d SET d.chat.message = (SELECT RAW d2.message FROM default AS d2 USE KEYS d.chat.docId WHERE d2.docType = "test")[0]
WHERE d.docType = "test2" AND d.chat.docId IS NOT NULL;