【发布时间】:2017-04-22 06:02:28
【问题描述】:
我正在尝试读取我收到的 json 中的内部对象。我需要按原样获取这个内部对象并将其插入 Mongo。
{
"order" : {
"customer" : {
"name" : "Custy McCustomer",
"contactDetails" : {
"address" : "1 Fake Street, London, England",
"phone" : "0123-456-789"
}
},
"items" : [
{
"id" : 123,
"description" : "banana",
"quantity" : 1
},
{
"id" : 456,
"description" : "apple",
"quantity" : 2
}
],
"total" : 123.45
}
}
【问题讨论】:
-
你指的是什么内部对象?
-
是的,很抱歉。在此示例中,它将是客户或项目
-
等等...这是 circe optics 文档页面上的示例?
-
是的。我显然必须用另一个 json 来做这个,但这是同样的问题。