JSONPath-Plus / JSONPath

A fork of JSONPath from http://goessner.net/articles/JsonPath/
Other
975 stars 175 forks source link

jsonpath always return false or array #83

Closed SimonCheung1989 closed 7 years ago

SimonCheung1989 commented 7 years ago

when i have a data structure like { city1: ['BJ'], city2: 'BJ' }

when i use jsonpath to get the json value, $.city1 it will return ['BJ'] $.city2 it will return ['BJ'] as well, then the question come out, how could i juddge the element type is a String or is an Array?

brettz9 commented 7 years ago

Set the flatten property to true.