html52.com
我爱小程序-开发者交流社区

一个集合里有多类型数据。比如type =1,type=2,type=3.每个类型很多条?

一个集合里有多类型数据。比如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": "斤"
        }],
        }

网友回复

stop eating:

stop eating:

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付