【问题标题】:NiFi EvaluateJsonPath array lengthNiFi EvaluateJsonPath 数组长度
【发布时间】:2020-02-29 21:38:49
【问题描述】:

我有以下 JSON:

{
    "hits": {
         "hits":[]
    }
}

(来自 ElasticSearch 的一些响应)。

我想使用处理器EvaluateJsonPath来获取hits.hits的长度。

我尝试了以下表达式:

$.hits.hits.length

但我收到以下错误:

FlowFile could not find path $['hits']['hits']['length'] for attribute key hits.:(错误到此结束)。

但是,当使用 JsonEvaluate 网站在线检查时,它似乎可以工作。

我的表情有什么问题?

【问题讨论】:

标签: json apache-nifi jsonpath json-path-expression


【解决方案1】:

JsonPath 好像有不同的版本。对我来说,$.hits.hits.length() 有效。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-13
    • 2012-09-06
    • 2014-07-20
    • 1970-01-01
    • 2014-07-27
    • 2018-10-08
    相关资源
    最近更新 更多