在这种情况下,如果defaultshipping为true,则应将手机放入shippingAddressBook->电话(计费相同(。我的转变很接近,但问题是它没有抓住";电话";。
有人能帮我吗?(
输入:
{
"phone": "869-947-4444",
"defaultshipping": false,
"defaultbilling": true
}
预期输出:
{
"billingAddressBook" : {
"phone" : "869-947-4444"
}
}
我的转型尝试:
[
{
"operation": "shift",
"spec": {
"defaultbilling": {
"true": {
"#phone": "billingAddressBook.phone"
}
},
"defaultshipping": {
"true": {
"#phone": "shippingAddressBook.phone"
}
}
}
}
]
是的,你已经很接近了,只需要提升2级就可以达到phone
的级别,并通过使用@(2,phone)
(如(来获取值
[
{
"operation": "shift",
"spec": {
"defaultbilling": {
"true": {
"@(2,phone)": "billingAddressBook.phone"
}
},
"defaultshipping": {
"true": {
"@(2,phone)": "shippingAddressBook.phone"
}
}
}
}
]