json-path/JsonPath

The first value obtained after filtering is abnormal

llm163520 opened this issue · 1 comments

public static void main(String[] args){
String json = "{"viewInfo":{"att1DtoList":[{"rowNo":1,"generalMonth":"1"}]}}";
DocumentContext documentContext = JsonPath.using(Configuration
.builder()
.mappingProvider(new JacksonMappingProvider())
.jsonProvider(new JacksonJsonProvider())
.build()).parse(json);
String generalMonth = documentContext.read("$.viewInfo.att1DtoList[?(@.rowNo == 1)].[0]['generalMonth']").toString();
//Actual result:[]
//Desired result:"1"
}

with link #834