我在mongodb中有以下三个集合:
//Drinkers
{
"drinkerId" : "ID1",
"name" : "name",
"lastName" : "lastname"
}
//Drinks
{
"drinkId" : "ID2",
"drinkName" : "wine",
"alcoholPercent" : 0.12
}
//Happy-Hours
{
"drinkerId" : "ID1",
"drinkId" : "ID1"
}
我还通过下面的mongo管道提交了一个关于happy hours集合的kafka连接器示例。
[
{
"$match": {
"operationType": "insert"
}
},
{
"$lookup": {
"from": "drinkers",
"localField": "fullDocument.drinkerId",
"foreignField": "drinkerId",
"as": "drinkerInfo"
}
},
{
"$unwind": "$drinkerInfo"
},
{
"$lookup": {
"from": "drinks",
"localField": "fullDocument.drinkId",
"foreignField": "drinkId",
"as": "drinkInfo"
}
},
{
"$unwind": "$drinkInfo"
}
]
当我查看kafka connect日志时,我看到以下消息:
warn无法恢复更改流:$changestream管道20中不允许查找
消息未发布到主题。
我真正的用例是,我将在drinkers和drinks集合中插入大型mongodb文档,并希望在happy hours集合中插入较小的文档。最终消费者需要饮酒者和饮品信息。
有没有其他方法让我检索饮酒者和饮料信息,并将详细信息发布到主题中?
暂无答案!
目前还没有任何答案,快来回答吧!