I have a JSON document where some values can be null. Using for expressions in json4s, how I can yield None, instead of nothing?
The following will fail to yield whe
The last command should look like:
for { JObject(thing) <- res1 } yield thing.collectFirst{case JField("PlanEstimate", JDouble(points)) => points}
Or like
for { JObject(thing) <- res1 points = thing.collectFirst{case JField("PlanEstimate", JDouble(p)) => p} } yield points