小程序数据库操作指令

弹性盒布局
display: flex;
/* flex-direction: column; /
/
flex-direction: row; /
/
flex-direction: column-reverse; /
/
flex-direction: row-reverse; /
/
justify-content: flex-start; /
/
justify-content: flex-end; /
/
justify-content: center; /
/
justify-content: space-between; /
/
align-items: center; /
/
align-items:flex-end; */
align-items: flex-start;

小程序的生命周期

小程序的数据库操作指令

  // 获得商品的列表信息
  // goodsList.get({
  //   success(res){
  //     console.log(res.data);
  //   }
  // })

  // then
  // goodsList.get().then(res=>{
  //   console.log(res.data);
  // })

  // await
  // const res = await goodsList.get();
  // console.log(res.data);

  // 根据条件进行查询
  // const res = await goodsList.where({
  //   goodsName:"山东大樱桃"
  // }).get()
  // console.log(res);

  //  doc 指定唯一标识,可以获得一条记录
  // const res = await goodsList.doc("pRXvo7RQ68rQo6EIiLsBuzzSa1e7hgFW79E4nPTrtmBlza6h").get();
  // console.log(res);

  // 价格大于30
  // const res = await goodsList.where({
  //   goodsPrice:_.gt(30)
  // }).get();
  // console.log(res);

  // 模糊
  // const res = await goodsList.where({
  //   goodsName:/广西/
  // }).get();
  // console.log(res);

  // field  select goodsName from goodsList
  // const res = await goodsList.field({
  //   goodsName:true,
  //   _id:false
  // }).get();
  // console.log(res.data);

  // order 排序: desc降序  asc 升序  sort
  // const res = await goodsList.orderBy("goodsPrice","asc").orderBy("goodsName","asc").get();
   
  // count 
  // const res = await goodsList.where({
  //   goodsName:/广西/
  // }).count();
  // console.log(res.total);

  // skip limit
  // const res = await goodsList.orderBy("goodsPrice","desc").limit(4).skip(2).get();
  
  // console.log(res.data);
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值