Getting a field in Scala json4s
How do I get a specific field from a Json object in Scala? I feel like I'm going in circles.
import org.json4s._
import org.json4s.jackson.JsonMethods._
val me = parse(""" {"name":"brian", "state":"frustrated"} """)
Now I only want a state. I was looking for something like
me("state") -> "frustrated"
I tried
me("state")
me.get("state")
me \ "state" <thanks for the idea>
me['state']
me.state
me.NOOOOOOOOOO!!!!!!!
reference
+3
source to share