Nena
Nena

Reputation: 701

Using JSONPath to extract variable or key name

I have a JSON string that's of the format:

[{"topic":0},{"topic2":2}]

Using jsonpath expression like:

$.*

I can extract the values, ie, 0, 2 - but I cant' find any way of getting the variable name to the left of the ':' - is this possible using JsonPath?

For example, I would want an expression that would give me: "topic", "topic2", (etc) (variable number of name/value pairs).

Upvotes: 2

Views: 2038

Answers (1)

Dmytro Pastovenskyi
Dmytro Pastovenskyi

Reputation: 5419

From what I know it's impossible.

Upvotes: 1

Related Questions