{
“restaurantId”:1, “名字”:“食物熊猫”, “dateAddedd”:1455647400000, “上次更改”:1455733800000, “restaurantUrl”“www.foodpanda.com” “restaurantType”: “中国人”, “描述”:“美味可口的食物”, “停车”:假的, “noOfTable”:80, “noOfwaiter”:990, “WiFi” 的:假,
“厂商ID”:1, “目录”:[ { “采用catalogId”:1, “CatalogName编”“食品”, “restaurantId”:1, “厂商ID”:1, “类别”:[ { “的categoryId”:1, “categoryName”:“southindian dosa”, “采用catalogId”:1, “restaurantId”:1, “厂商ID”:1,
"subCategory":[
{
"subCategoryId":1,
"catalogId":1,
"catCategory_Id":1,
"vendorId":1,
"restaurantId":1,
"subCategoryName":"chapatti",
"product":[
{"productId":2,
"vendorId":2,
"restaurantId":1,
"calalogId":1,
"catCategoryId":2,
"subCategoryId":1,
"taxClassId":12,
"activationDate":1455906600000,
"availability":false,
"discound":12.0,
"hot":true,
"listPrice":120.0,
"longDescription":"Description",
"productName":"Mobile",
"sellingPrice":3000.0,
"weight":20,
"productOption":[
]}]}]}]},
{
"catalogId":2,
"catalogName":"drinks",
"restaurantId":1,
"vendorId":1,
"category":[
{
"categoryId":2,
"categoryName":"Norythindian dosa",
"catalogId":2,
"restaurantId":1,
"vendorId":1,
"subCategory":[
{"subCategoryId":3,
"catalogId":1,
"catCategory_Id":2,
"vendorId":1,
"restaurantId":1,
"subCategoryName":"Paratha",
"product":[]},
{
"subCategoryId":2,
"catalogId":2,
"catCategory_Id":2,
"vendorId":1,
"restaurantId":1,
"subCategoryName":"apple juice",
"product":[
{
"productId":1,
"vendorId":1,
"restaurantId":1,
"calalogId":1,
"catCategoryId":1,
"subCategoryId":2,
"taxClassId":10,
"activationDate":1455733800000,
"availability":true,"discound":0.0,
"hot":true,
"listPrice":10.0,
"longDescription":"onion dosa with butter",
"productName":"oninoin dosa",
"sellingPrice":12.6,
"weight":100,
"productOption":[
{
"productOptionId":1,
"productId":1,
"optionName":"coca cola drinks",
"optionValues":"200",
"comment":"all the dishes are available ",
"price":10.0},
{
"productOptionId":2,
"productId":1,
"optionName":"coca cola drinks",
"optionValues":"500",
"comment":"allncjncjd cndknc mcnmdc",
"price":20.0}
]}
]}
]}
]}
]}
答案 0 :(得分:0)
你的意思是这样吗?
var obj = {
"restaurantId" : 1,
"name" : "food panda",
"dateAddedd" : 1455647400000,
"lastModified" : 1455733800000,
"restaurantUrl" : "www.foodpanda.com",
"restaurantType" : "chinese",
"description" : "good and delicious food",
"parking" : false,
"noOfTable" : 80,
"noOfwaiter" : 990,
"wifi" : false,
"vendorId" : 1,
"catalog" : [{
"catalogId" : 1,
"catalogName" : "food",
"restaurantId" : 1,
"vendorId" : 1,
"category" : [{
"categoryId" : 1,
"categoryName" : "southindian dosa",
"catalogId" : 1,
"restaurantId" : 1,
"vendorId" : 1,
"subCategory" : [{
"subCategoryId" : 1,
"catalogId" : 1,
"catCategory_Id" : 1,
"vendorId" : 1,
"restaurantId" : 1,
"subCategoryName" : "chapatti",
"product" : [{
"productId" : 2,
"vendorId" : 2,
"restaurantId" : 1,
"calalogId" : 1,
"catCategoryId" : 2,
"subCategoryId" : 1,
"taxClassId" : 12,
"activationDate" : 1455906600000,
"availability" : false,
"discound" : 12.0,
"hot" : true,
"listPrice" : 120.0,
"longDescription" : "Description",
"productName" : "Mobile",
"sellingPrice" : 3000.0,
"weight" : 20,
"productOption" : [
]
}
]
}
]
}
]
}, {
"catalogId" : 2,
"catalogName" : "drinks",
"restaurantId" : 1,
"vendorId" : 1,
"category" : [{
"categoryId" : 2,
"categoryName" : "Norythindian dosa",
"catalogId" : 2,
"restaurantId" : 1,
"vendorId" : 1,
"subCategory" : [{
"subCategoryId" : 3,
"catalogId" : 1,
"catCategory_Id" : 2,
"vendorId" : 1,
"restaurantId" : 1,
"subCategoryName" : "Paratha",
"product" : []
}, {
"subCategoryId" : 2,
"catalogId" : 2,
"catCategory_Id" : 2,
"vendorId" : 1,
"restaurantId" : 1,
"subCategoryName" : "apple juice",
"product" : [{
"productId" : 1,
"vendorId" : 1,
"restaurantId" : 1,
"calalogId" : 1,
"catCategoryId" : 1,
"subCategoryId" : 2,
"taxClassId" : 10,
"activationDate" : 1455733800000,
"availability" : true,
"discound" : 0.0,
"hot" : true,
"listPrice" : 10.0,
"longDescription" : "onion dosa with butter",
"productName" : "oninoin dosa",
"sellingPrice" : 12.6,
"weight" : 100,
"productOption" : [{
"productOptionId" : 1,
"productId" : 1,
"optionName" : "coca cola drinks",
"optionValues" : "200",
"comment" : "all the dishes are available ",
"price" : 10.0
}, {
"productOptionId" : 2,
"productId" : 1,
"optionName" : "coca cola drinks",
"optionValues" : "500",
"comment" : "allncjncjd cndknc mcnmdc",
"price" : 20.0
}
]
}
]
}
]
}
]
}
]
}
console.log(JSON.stringify(obj,null,2))