当前位置: 首页 > news >正文

网站建设和维护方案wordpress图片分页插件

网站建设和维护方案,wordpress图片分页插件,郴州全网推广公,郑州网站建设亅汉狮网络where介绍 在uniCloud中#xff0c;WHERE是一个用于指定查询条件的关键字。它允许用户根据特定的条件来筛选和查询云数据库中的数据。WHERE语句的基本语法格式是WHERE condition#xff0c;其中condition表示查询条件#xff0c;可以是一个或多个逻辑表达式组成的条件。 在…where介绍 在uniCloud中WHERE是一个用于指定查询条件的关键字。它允许用户根据特定的条件来筛选和查询云数据库中的数据。WHERE语句的基本语法格式是WHERE condition其中condition表示查询条件可以是一个或多个逻辑表达式组成的条件。 在uniCloud的查询操作中WHERE子句的使用非常灵活可以支持多种查询条件包括等于、不等于、大于、小于、范围查询等。同时它还可以支持多个条件的组合查询通过逻辑运算符如AND、OR将多个条件连接起来实现更复杂的查询需求。 此外WHERE子句还支持正则表达式查询可以使用正则表达式来匹配和筛选符合特定模式的数据。这使得在处理文本数据时能够更加精确地定位到所需的信息。 WHERE在uniCloud中是一个强大的查询工具能够帮助用户快速、准确地获取所需的数据。无论是简单的条件查询还是复杂的组合查询都可以通过WHERE子句来实现。 要查看本文章,请先阅读unicloud 集合 Collection 详解及其使用示例 示例教程如下 where 简单使用(查询对象) 使用where查询时如果传入的参数是一个对象将按照字段的值进行相等匹配包含字段顺序。 如查看users表内年龄是38岁的人 示例代码如下 云函数代码 use strict; exports.main async (event, context) {const result await uniCloud.database().collection(users).where({age:38}).get()//返回数据给客户端return result }; 页面引用代码 const where async _{const result await uniCloud.callFunction({name:where})console.log(result) }输出结果如下 可以看到,将age为38的都查询出来了 where 高级使用(查询指令) 查询指令以dbCmd.开头包括等于、不等于、大于、大于等于、小于、小于等于、in、nin、and、or。 tips: 以下指令挂载在 db.command 下 指令图表如下 指令描述说明eq等于name:dbCmd.eq(‘qayrup’)neq不等于删除字段gt大于加一个数值原子自增gte大于等于乘一个数值原子自乘it小于数组类型字段追加尾元素支持数组ite小于等于数组类型字段删除尾元素支持数组in在数组中数组类型字段删除头元素支持数组nin不再数组中数组类型字段追加头元素支持数组and且数组类型字段追加头元素支持数组or或数组类型字段追加头元素支持数组 eq 等于 表示字段等于某个值。eq 指令接受一个字面量 (literal)可以是 number, boolean, string, object, array。 事实上在uniCloud的数据库中等于有两种写法。 比如筛选名字为qayrup的 第一种写法使用对象 云函数示例代码 use strict; exports.main async (event, context) {const result await uniCloud.database().collection(users).where({name:qayrup}).get()//返回数据给客户端return result }; 输出结果 第二种写法使用eq指令 云函数代码如下 use strict; exports.main async (event, context) {// 查询字段等于某个值 第一种写法// const result await uniCloud.database().collection(users).where({name:qayrup}).get()// 查询字段等于某个值 第二个写法 使用eqconst result await uniCloud.database().collection().where({name:uniCloud.database().command.eq(qayrup)})return result }; 输出结果如下 neq 不等于 字段不等于。neq 指令接受一个字面量 (literal)可以是 number, boolean, string, object, array。 例如筛选出age不为38的数据 示例代码如下 use strict; const db uniCloud.database() const dbCmd db.command exports.main async (event, context) {// 查询字段等于某个值 第一种写法// const result await uniCloud.database().collection(users).where({name:qayrup}).get()// 查询字段等于某个值 第二个写法 使用eq// const result await uniCloud.database().collection(users).where({// name:uniCloud.database().command.eq(qayrup)// }).get()// 查询 age 不等于38的const result await db.collection(users).where({age:dbCmd.neq(38)}).get()return result }; 输出结果如下 gt 大于 字段大于指定值。 如筛选年龄大于20的 示例代码如下 use strict; const db uniCloud.database() const dbCmd db.command exports.main async (event, context) {// 查询字段等于某个值 第一种写法// const result await uniCloud.database().collection(users).where({name:qayrup}).get()// 查询字段等于某个值 第二个写法 使用eq// const result await uniCloud.database().collection(users).where({// name:uniCloud.database().command.eq(qayrup)// }).get()// 查询 age 不等于38的// const result await db.collection(users).where({// age:dbCmd.neq(38)// }).get()const result await db.collection(users).where({age:dbCmd.gt(20)}).get()return result }; 输出结果如下 gte 大于等于 字段大于或等于指定值。 筛选年龄大于等于18的 示例代码如下 use strict; const db uniCloud.database() const dbCmd db.command exports.main async (event, context) {// 查询字段等于某个值 第一种写法// const result await uniCloud.database().collection(users).where({name:qayrup}).get()// 查询字段等于某个值 第二个写法 使用eq// const result await uniCloud.database().collection(users).where({// name:uniCloud.database().command.eq(qayrup)// }).get()// 查询 age 不等于38的// const result await db.collection(users).where({// age:dbCmd.neq(38)// }).get()// 筛选年龄大于20的// const result await db.collection(users).where({// age:dbCmd.gt(20)// }).get()// 筛选年龄大于等于18的const result await db.collection(users).where({age:dbCmd.gte(18)}).get()return result }; 输出结果如下 lt 小于 字段小于指定值。 筛选年龄小于20的 示例代码如下 use strict; const db uniCloud.database() const dbCmd db.command exports.main async (event, context) {// 查询字段等于某个值 第一种写法// const result await uniCloud.database().collection(users).where({name:qayrup}).get()// 查询字段等于某个值 第二个写法 使用eq// const result await uniCloud.database().collection(users).where({// name:uniCloud.database().command.eq(qayrup)// }).get()// 查询 age 不等于38的// const result await db.collection(users).where({// age:dbCmd.neq(38)// }).get()// 筛选年龄大于20的// const result await db.collection(users).where({// age:dbCmd.gt(20)// }).get()// 筛选年龄大于等于18的// const result await db.collection(users).where({// age:dbCmd.gte(18)// }).get()// 筛选年龄小于20的const result await db.collection(users).where({age:dbCmd.lt(20)}).get()return result }; 输出结果如下 lte 小于等于 字段小于或等于指定值。 筛选小于等于18的 示例代码如下 use strict; const db uniCloud.database() const dbCmd db.command exports.main async (event, context) {// 查询字段等于某个值 第一种写法// const result await uniCloud.database().collection(users).where({name:qayrup}).get()// 查询字段等于某个值 第二个写法 使用eq// const result await uniCloud.database().collection(users).where({// name:uniCloud.database().command.eq(qayrup)// }).get()// 查询 age 不等于38的// const result await db.collection(users).where({// age:dbCmd.neq(38)// }).get()// 筛选年龄大于20的// const result await db.collection(users).where({// age:dbCmd.gt(20)// }).get()// 筛选年龄大于等于18的// const result await db.collection(users).where({// age:dbCmd.gte(18)// }).get()// 筛选年龄小于20的// const result await db.collection(users).where({// age:dbCmd.lt(20)// }).get()// 筛选年龄小于等于十八的const result await db.collection(users).where({age:dbCmd.lte(18)}).get()return result }; 输出结果如下 in 在数组中 字段值在给定的数组中。 use strict;const { setUncaughtExceptionCaptureCallback } require(process);const db uniCloud.database() const dbCmd db.command exports.main async (event, context) {// 查询字段等于某个值 第一种写法// const result await uniCloud.database().collection(users).where({name:qayrup}).get()// 查询字段等于某个值 第二个写法 使用eq// const result await uniCloud.database().collection(users).where({// name:uniCloud.database().command.eq(qayrup)// }).get()// 查询 age 不等于38的// const result await db.collection(users).where({// age:dbCmd.neq(38)// }).get()// 筛选年龄大于20的// const result await db.collection(users).where({// age:dbCmd.gt(20)// }).get()// 筛选年龄大于等于18的// const result await db.collection(users).where({// age:dbCmd.gte(18)// }).get()// 筛选年龄小于20的// const result await db.collection(users).where({// age:dbCmd.lt(20)// }).get()// 筛选年龄小于等于十八的// const result await db.collection(users).where({// age:dbCmd.lte(18)// }).get()// return result// 名字在[qayrup,张三,ggbond] 内const result await db.collection(users).where({name:dbCmd.in([qayrup,张三,ggbond] )}).get()return result }; 输出结果如下 nin 不在数组中 字段值不在给定的数组中。 名字不在[‘qayrup’,‘张三’,‘ggbond’] 内 示例代码如下 use strict;const { setUncaughtExceptionCaptureCallback } require(process);const db uniCloud.database() const dbCmd db.command exports.main async (event, context) {// 查询字段等于某个值 第一种写法// const result await uniCloud.database().collection(users).where({name:qayrup}).get()// 查询字段等于某个值 第二个写法 使用eq// const result await uniCloud.database().collection(users).where({// name:uniCloud.database().command.eq(qayrup)// }).get()// 查询 age 不等于38的// const result await db.collection(users).where({// age:dbCmd.neq(38)// }).get()// 筛选年龄大于20的// const result await db.collection(users).where({// age:dbCmd.gt(20)// }).get()// 筛选年龄大于等于18的// const result await db.collection(users).where({// age:dbCmd.gte(18)// }).get()// 筛选年龄小于20的// const result await db.collection(users).where({// age:dbCmd.lt(20)// }).get()// 筛选年龄小于等于十八的// const result await db.collection(users).where({// age:dbCmd.lte(18)// }).get()// return result// 名字在[qayrup,张三,ggbond] 内// const result await db.collection(users).where({// name:dbCmd.in([qayrup,张三,ggbond] )// }).get()// 名字不在[qayrup,张三,ggbond] 内const result await db.collection(users).where({name:dbCmd.nin([qayrup,张三,ggbond] )}).get()return result }; 输出结果如下 and 且 表示需同时满足指定的两个或以上的条件。 筛选出 年龄大于20且小于50的 示例代码如下 use strict;const { setUncaughtExceptionCaptureCallback } require(process);const db uniCloud.database() const dbCmd db.command exports.main async (event, context) {// 查询字段等于某个值 第一种写法// const result await uniCloud.database().collection(users).where({name:qayrup}).get()// 查询字段等于某个值 第二个写法 使用eq// const result await uniCloud.database().collection(users).where({// name:uniCloud.database().command.eq(qayrup)// }).get()// 查询 age 不等于38的// const result await db.collection(users).where({// age:dbCmd.neq(38)// }).get()// 筛选年龄大于20的// const result await db.collection(users).where({// age:dbCmd.gt(20)// }).get()// 筛选年龄大于等于18的// const result await db.collection(users).where({// age:dbCmd.gte(18)// }).get()// 筛选年龄小于20的// const result await db.collection(users).where({// age:dbCmd.lt(20)// }).get()// 筛选年龄小于等于十八的// const result await db.collection(users).where({// age:dbCmd.lte(18)// }).get()// return result// 名字在[qayrup,张三,ggbond] 内// const result await db.collection(users).where({// name:dbCmd.in([qayrup,张三,ggbond] )// }).get()// 名字不在[qayrup,张三,ggbond] 内// const result await db.collection(users).where({// name:dbCmd.nin([qayrup,张三,ggbond] )// }).get()// 筛选出 年龄大于20且小于50的const result await db.collection(users).where({age:dbCmd.gt(20).and(dbCmd.lt(50))}).get()return result }; 结果如下 or 或 表示需满足所有指定条件中的至少一个。 筛选 年龄等于18或年龄等38的 示例代码如下 use strict;const { setUncaughtExceptionCaptureCallback } require(process);const db uniCloud.database() const dbCmd db.command exports.main async (event, context) {// 查询字段等于某个值 第一种写法// const result await uniCloud.database().collection(users).where({name:qayrup}).get()// 查询字段等于某个值 第二个写法 使用eq// const result await uniCloud.database().collection(users).where({// name:uniCloud.database().command.eq(qayrup)// }).get()// 查询 age 不等于38的// const result await db.collection(users).where({// age:dbCmd.neq(38)// }).get()// 筛选年龄大于20的// const result await db.collection(users).where({// age:dbCmd.gt(20)// }).get()// 筛选年龄大于等于18的// const result await db.collection(users).where({// age:dbCmd.gte(18)// }).get()// 筛选年龄小于20的// const result await db.collection(users).where({// age:dbCmd.lt(20)// }).get()// 筛选年龄小于等于十八的// const result await db.collection(users).where({// age:dbCmd.lte(18)// }).get()// return result// 名字在[qayrup,张三,ggbond] 内// const result await db.collection(users).where({// name:dbCmd.in([qayrup,张三,ggbond] )// }).get()// 名字不在[qayrup,张三,ggbond] 内// const result await db.collection(users).where({// name:dbCmd.nin([qayrup,张三,ggbond] )// }).get()// 筛选出 年龄大于20且小于50的// const result await db.collection(users).where({// age:dbCmd.gt(20).and(dbCmd.lt(50))// }).get()// 筛选 年龄等于18或年龄等38的const result await db.collection(users).where({age:dbCmd.eq(18).or(dbCmd.eq(38))}).get()return result }; 输出结果如下 正则表达式查询 db.RegExp 根据正则表达式进行筛选 正则表达式忘得差不多了,这里就不做示例了 以上指令所示例的数据集 [{_id:65ea848410def2d7fe8efb6a,age:18,email:qayrupaliyun.com,intro:长得像吴彦祖,name:qayrup}, {_id:65eaa7175e058d32ec579fe7,age:38,email:zhangshanemail.com,intro:一个普普通通的律师,name:张三,uniIdToken:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiI2NTg4M2Y3MTZlNWQyZDcxODc5MDAxYjEiLCJyb2xlIjpbXSwicGVybWlzc2lvbiI6W10sInVuaUlkVmVyc2lvbiI6IjEuMC4xNiIsImlhdCI6MTcwMzQyNzk0NCwiZXhwIjoxNzAzNDM1MTQ0fQ.hy40ZsKGvtnm4IDA0HpOFYwhE-5x69OZXQcZ57EoTO8}, {_id:65eaa82b358ba96e9f0fe233,age:38,email:ggbondemail.com,intro:一只猪,name:ggbond}, {_id:65eaa82b358ba96e9f0fe234,age:38,email:zhubajieemail.com,intro:一直吃素的猪,name:猪八戒}, {_id:65eaa82b358ba96e9f0fe235,age:38,email:peiqiemail.com,intro:一只吹风机,name:佩奇}]
http://www.zqtcl.cn/news/263642/

相关文章:

  • 网站建设签收单网页制作模板的作用
  • 已购买域名 如何做网站网络规划设计师通过率多少
  • 酒店网站建设需求分析wordpress iis
  • 烟台网站建设服务新钥匙网站建设
  • 帝国cms网站地图生成器行业网站建设哪家专业
  • 免费推广网站大全wordpress更改图片大小
  • 中航建设集团网站vps网站无法通过ip访问
  • 学生求职网站的需求分析怎么做江西手机版建站系统开发
  • 电商网站开发文献综述嵌入式软件开发项目
  • 网站备案怎样提交管局网站建设基本步骤
  • 国外优秀电商设计网站开发网站公司推荐
  • 国外企业网站建设模型网站建设谈客户说什么
  • 肖港网站开发公司网站的用途
  • 百度网站置顶怎么做效果图制作设计
  • 自适应企业网站用什么框架做重庆在线观看
  • 网站做301重定向的作用辽宁网站建设电话
  • 抚州市建设局官方网站高端网页设计人才
  • 移动商城网站建设 深圳北京网站建站公
  • 网站的对比免费网站建设排名
  • 织梦做的网站别人提交给我留的言我去哪里看怎样发展网站
  • 滨州公司网站建设推广地下城做解封任务的网站
  • 做国外的众筹网站北京的网站建设公司哪家好
  • 网站建设费用一年多少钱商洛城乡建设局网站
  • 网站视觉设计原则四个商城建设
  • WordPress站点添加ssl证书网站在百度无法验证码怎么办
  • 做ppt图片用的网站有哪些问题搭建网站合同
  • 杭州网站建设推荐q479185700上墙网站推广费用入什么科目
  • 天津网站建设 熊掌号设计网站大全
  • 网站建设不力 被问责上海传媒公司有哪些
  • 在线购物网站的设计阿里巴巴网站建设