I have a Json object stored in Mongo like below. It is 'flat', i.e. no nested elements:
{
"key1" : "val1",
"key2" : "val2",
....
"keyn" : "valn"
}
I have fetched it as a JsArray. I also have a case class:
case class IndividualProduct(key1: String, key2: String, ... , key_n: String) {}
In total the Json will have over 40 key/value pairs. Is there a neat way to parse the JsArray into the case class without verbosely referencing the keys?
thanks in advance - Future[Thanks]