0

I have a json file like below.

{"trackId":610957461,"countryCode":"TR","deviceType":"IPHONE","date":"2020-10-01","rankings":
[
{"keyword":"boyner","rank":1},
{"keyword":"giyim","rank":1},
{"keyword":"ykm","rank":1},
{"keyword":"colin\\s","rank":1},
{"keyword":"erkek giyim","rank":1},
{"keyword":"boyner kart","rank":1},
{"keyword":"giyim siteleri","rank":1}
]}

When i set json path like $, I see that only trackid,countrycode,devicetype,date columns. I want keyword and rank columns in addition to these.

correct format

So What is the right json path for this columns?

1 Answers1

0

Using this expression (using Jayway)

$..["rankings"]..["keyword", "rank"]

outputs

[
   {
      "keyword" : "boyner",
      "rank" : 1
   },
   {
      "keyword" : "giyim",
      "rank" : 1
   },
   {
      "keyword" : "ykm",
      "rank" : 1
   },
   {
      "keyword" : "colin\\s",
      "rank" : 1
   },
   {
      "keyword" : "erkek giyim",
      "rank" : 1
   },
   {
      "keyword" : "boyner kart",
      "rank" : 1
   },
   {
      "keyword" : "giyim siteleri",
      "rank" : 1
   }
]
Jack Fleeting
  • 24,385
  • 6
  • 23
  • 45
  • I want other columns(track id, date etc) in a per event. This involves only ranking parameters. – Ufuk AKÇAY Oct 28 '20 at 12:28
  • @UfukAKÇAY Then your question isn't clear: you said you already have trackid, etc, and you only need the rankings. – Jack Fleeting Oct 28 '20 at 12:34
  • I used this sentences "I want keyword and rank columns in addition to these." I added final table. I think that you didn't all of question. So thanks for interesting, I m grateful to you. Sorry for if i didn't explain question clearly. – Ufuk AKÇAY Oct 28 '20 at 13:39