title: get Json head node value in Scala
body: <p>I'm a beginner of Scala and using lib "<strong>json4s</strong>" for JSON parsing, and I have JSON data formatted like below:</p>
  
  <pre><code>scala&gt; val str = """
   | {
   |     "index_key": {
   |         "time":"12938473",
   |         "event_detail": {
   |             "event_name":"click",
   |             "location":"US"
   |         }
   |     }
   | }
   | """
  </code></pre>
  
  <p>I'm trying to get "index_key" and sign it to a variable. I tried below:</p>
  
  <pre><code>scala&gt; val json = parse(str)
  json: org.json4s.JValue = JObject(List((index_key,JObject(List((time,JString(12938473)), (event_detail,JObject(List((event_name,JString(click)), (location,JString(US))))))))))
  
  scala&gt; json.values
  res40: json.Values = Map(index_key -&gt; Map(time -&gt; 12938473, event_detail -&gt; Map(event_name -&gt; click, location -&gt; US)))
  </code></pre>
  
  <p>and I can get the Map from "json.values" by "json.values.head" or "json.values.keys". But I cannot get the first key "index_key" from this map. Could anyone please tell me <strong>how to get map key value "index_key"</strong>? and what "res40: json.Values" has to do with Map type? Thanks a lot.</p>