I'm at scala play 2.6.10 I have a json:
{"_id": {"$oid": "VALUE"}, "anotherField": "anotherValue"}
The goal is to get rid of {"$oid": "VALUE"}
and put "VALUE"
as the value for "_id"
field.
Expected result:
{"_id": "VALUE", "anotherField": "anotherValue"}
Tried this one: https://www.playframework.com/documentation/2.8.x/ScalaJsonTransformers
i have absolutely no idea how to combine
- extract specific branch value
- "prune" of JsObject
- "update" deleted JsObject with JsString.
BTW, is there any simpler API for doing it? This one is way too complex.