一个集合里有多类型数据。比如type =1,type=2,type=3.每个类型很多条。现在云开发写查询语句,如何一个查询语句能获得每个类型各三条数据,比如三个类型就是三个数组,放在一个json里面。希望能获取如下格式
{
type:1
"data": [{
"_id": "6518b7395f5884e10133e7e37a132595",
"New_unit_Pricre": "6",
"Old_unit_Price": "8",
"weighing_unit": "斤"
}, {
"_id": "b5416b755f58c389017171e11ea0a0c2",
"New_unit_Pricre": "6",
"Old_unit_Price": "8",
"weighing_unit": "斤"
}, {
"_id": "ac5f38825f58c48c014279235af06d50",
"New_unit_Pricre": "6",
"Old_unit_Price": "8",
"weighing_unit": "斤"
}],
}{
type:2
"data": [{
"_id": "6518b7395f5884e10133e7e37a132595",
"New_unit_Pricre": "6",
"Old_unit_Price": "8",
"weighing_unit": "斤"
}, {
"_id": "b5416b755f58c389017171e11ea0a0c2",
"New_unit_Pricre": "6",
"Old_unit_Price": "8",
"weighing_unit": "斤"
}, {
"_id": "ac5f38825f58c48c014279235af06d50",
"New_unit_Pricre": "6",
"Old_unit_Price": "8",
"weighing_unit": "斤"
}],
}