当前位置: 首页 > 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.pierceye.com/news/263642/

相关文章:

  • 做网站要多少的服务器网站设计的步骤
  • 网站关键词怎么做上首页wordpress 架构原理
  • 厦门专业网站建设代理国外在线crm系统suitecrm
  • 哪个网站可以领手工活在家做wordpress heroku
  • 为什么没有网站做图文小说电子商务网站开发的课程介绍
  • 在哪个网站做问卷好单页面网站推广
  • 专业网站建设模块维护静海网站建设
  • 国内前十网站建设公司龙之网官网
  • 昆山做网站的公昆山做网站的公司司网站开发与设计岗位职责
  • 网站投注员怎么做做旅游项目用哪家网站好
  • 环县网站怎么做咸阳网站开发公司地址
  • 重庆巴南网站制作wordpress外贸建站公司
  • 桂林旅游网站制作公司软件开发公司属于什么行业
  • 网站 备案 中国 名字老薛主机 wordpress
  • 有什么网站可以做投票功能合肥房地产交易网
  • 世界网站广西建设工程质检安全网站
  • 建设银行网站会员基本信息wordpress主题图片丢失
  • 找人做网站需要注意什么问题中国建设信用卡网站
  • 公众号制作的网站开发营销平台推广
  • 河源手机网站制作网站页面效果图怎么做
  • 公司网站建设要注意的问题wordpress上传图片x
  • 网站开发PHP留言本快代理
  • 温州做网站价格怎么做简易手机网站
  • 东营网站建设制作广州物流网站建设
  • 新乡建设工程信息网站kindeditor wordpress
  • 做一个京东这样的网站需要多少钱上网导航网页是哪家公司
  • 网站开发到上线的流程外贸网站 开源站建设行吗
  • 神华科技网站建设个人网站做哪些流程
  • 怎么查看网站空间是否到期如何用百度上传图片做网站外链
  • 可以做问卷挣钱的网站酒泉建设局网站