【问题标题】:Mule with MongoDB骡子与 MongoDB
【发布时间】:2016-09-23 12:16:59
【问题描述】:

我在下面的 mule 流中有一个 Mongodb 查询,并将输出定位到浮点变量。

<enricher target="#[flowVars.service]" doc:name="Message Enricher">
    <mongo:find-objects-using-query-map config-ref="Mongo_DB" collection="hosts" doc:name="query hosts">
        <mongo:query-attributes>
            <mongo:query-attribute key="id">45</mongo:query-attribute>
        </mongo:query-attributes>
    </mongo:find-objects-using-query-map>
</enricher>

如何使用 mule 表达式访问下面输出 json 中的域值?谢谢。

{ "_id" : { "$oid" : "57e230df56a0750c39ad395d"} , "id" : "45" , "domain" : "www.abc.com" , "port" : "80" , "path" : "posts/1"}

【问题讨论】:

    标签: mongodb mule esb


    【解决方案1】:

    您可以在MEL 中使用JsonPath 查询JSON 消息payloads 进行过滤或丰富,例如#[json:domain]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多