Md.Riad Hasan Sarker
01/22/2024, 10:09 AMGroupBy Query
taxonomies.segemnt
Data
[
{
"id":1,
"title":"Product 1",
"status":"active",
"order_idx":1,
"taxonomies":{
"segment":[
"segment_1"
]
}
},
{
"id":2,
"title":"Product 2",
"status":"active",
"order_idx":2,
"taxonomies":{
"segment":[
"segment_1",
"segment_2"
]
}
},
{
"id":3,
"title":"Product 3",
"status":"active",
"order_idx":3,
"taxonomies":{
"segment":[
"segment_2"
]
}
},
{
"id":4,
"title":"Product 4",
"status":"active",
"order_idx":4,
"taxonomies":{
"segment":[
"segment_2"
]
}
}
]
Expected Result
[
{
"key":"segment_1",
"value":[
"Product 1",
"Product 2"
]
},
{
"key":"segment_2",
"value":[
"Product 2",
"Product 3",
"Product 4"
]
}
]
Problem Facing
Some key not get all products (my debug point . order_idx: asc not working properly)