Creating a new map from json JsObject
===

I have the following json string:

    {"1342558874663000":{"TEMPERATURE_C":"253","TEMPERATURE_F":"775"},
    "1342558854606000":{"TEMPERATURE_C":"254","TEMPERATURE_F":"776"}}

I would like to iterate though this object and create a new json object with the format:

    {"TEMPERATURE_C":[["1342558874663000","253"], ["1342558854606000","254"]],
    "TEMPERATURE_F":[["1342558874663000", "775"], ["1342558854606000","776"]]}

I am trying to do the following but can't quite figure out how to create the new map:

    json.fields.foreach {
            case (epoch, obj) => {
              val newVal = obj.as[JsObject].fields.map {
                case (temps, value) => {
                  Map(temps -> (epoch, value.as[String])).toMap
                }
              }
              println(newVal)
            }
          }