i have 4 collections like
division,
category,
productgroup,
product
these all are my data's which is stored in collection my division collecion data's
{
"divisionid": "1",
"divisioncode": "0",
"divisionname": "ELECTRONICS/HOME APPLIANCE",
"divisionpoint": "2"
},
{
"divisionid": "2",
"divisioncode": "1",
"divisionname": "FOODS",
"divisionpoint": "8"
}
category collection data's
{
"categoryid": "1",
"divisionid": "1",
"categorycode": "34",
"categoryname": "AUDIO SYSTEM",
"categorypoint": "Null"
},
{
"categoryid": "2",
"divisionid": "1",
"categorycode": "348",
"categoryname": "DVD/VCD",
"categorypoint": "8"
}
productgroup collection data's
{
"productgroupid": "1",
"divisionid": "1",
"categoryid": "1",
"productgroupname": "ADAPTOR",
"productgroupcode": "6765",
"productgrouppoint": "7"
},
{
"productgroupid": "2",
"divisionid": "1",
"categoryid": "2",
"productgroupname": "WALKMAN",
"productgroupcode": "7659",
"productgrouppoint": "Null"
}
product collection data's
{
"productid": "1",
"divisionid": "1",
"categoryid": "1",
"productgroupid":"1",
"productname":"UNIVERSAL AC DC ADAPTER-PCS",
"productcode": "1000054",
"productpoint": "1"
},
{
"productid": "2",
"divisionid": "1",
"categoryid": "2",
"productgroupid":"2",
"productname":"WALKMAN WM#M470-PCS",
"productcode": "1000089",
"productpoint": "2"
}
i want to combine these 4 collection into one collection.
my expectation result:
productsummary
{
"product": {
"point": "1",
"name": "UNIVERSAL AC DC ADAPTER-PCS",
"code": "10000054",
"id" :"1"
},
"group": {
"point": "7",
"name": "ADAPTOR",
"id" :"1"
},
"category": {
"point": "0",
"name": "AUDIO SYSTEM",
"id" :"1"
},
"division": {
"point": "2",
"name": "ELECTRONICS/HOME APPLIANCE",
"id" :"1"
}
},
{
"product": {
"point": "2",
"name": "WALKMAN WM#M470-PCS",
"code": "1000089",
"id" :"2"
},
"group": {
"point": "7",
"name": "WALKMAN",
"id" :"Null"
},
"category": {
"point": "8",
"name": "DVD/VCD",
"id" :"2"
},
"division": {
"point": "2",
"name": "ELECTRONICS/HOME APPLIANCE",
"id" :"1"
}
}
when i do below ansered code i m getting error