首页 > 技术文章 > 微信小程序云开发-数据库-查询满足条件的数据

AnnLing 2021-07-15 14:41 原文

一、查询价格大于10的商品

1.wxml文件

 

 2.js文件

where条件语句:.where({price:db.command.gt(10)}) 

 

 3.查询结果

 

 

 二、查询价格大于等于10的商品

js文件,where条件语句:.where({price:db.command.gte(10)}) 

 

 三、查询价格小于10的商品

js文件,where条件语句:.where({price:db.command.lt(10)}) 

 

 

 四、查询价格小于等于10的商品

js文件,where条件语句:.where({price:db.command.lte(10)}) 

 

 五、查询价格等于10的商品

js文件,where条件语句:.where({price:db.command.eq(10)}) 

 

 六、查询价格大于5小于10的商品

js文件,where条件语句:.where({price:monica.gt(5)&&monica.lt(10)}) 

 

 

推荐阅读