2

我有以下 JSON:

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

(来自 ElasticSearch 的一些回应)。

我想使用处理器EvaluateJsonPath来获取hits.hits.

我尝试了以下表达式:

$.hits.hits.length

但我收到以下错误:

FlowFile could not find path $['hits']['hits']['length'] for attribute key hits.:(这就是错误的结束)。

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

我的表情有什么问题吗?

4

1 回答 1

5

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

于 2020-02-29T22:35:35.030 回答