我已使用以下配置创建了数据库连接器。
<db:generic-config name="Generic_Database_Configuration"
url="jdbc:mongodb://localhost:27017/test"
driverClassName="mongodb.jdbc.MongoDriver"
doc:name="Generic Database Configuration"/>
将以下有效负载插入测试数据库中的集合的查询语句是什么?
Payload: {
_id: ObjectId(7df78ad8902c),
title: 'MongoDB Overview',
description: 'MongoDB is no sql database',
by: 'tutorials point',
url: 'http://www.tutorialspoint.com',
tags: ['mongodb', 'database', 'NoSQL'],
likes: 100
}
答案 0 :(得分:0)
试试这个:
<dw:transform-message doc:name="Transform Message">
<dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
{ _id: ObjectId(7df78ad8902c),
title: 'MongoDB Overview',
description: 'MongoDB is no sql database',
by: 'tutorials point',
url: 'http://www.tutorialspoint.com',
tags: ['mongodb', 'database', 'NoSQL'],
likes: 100
}]]></dw:set-payload>
</dw:transform-message>
<mongo:insert-document config-ref="Mongo_DB__Configuration" collection="COLLECTION_NAME" doc:name="Insert Document"/>
<mongo:document-to-json doc:name="Document to Json"/>