日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)小程序教程:微信小程序云開發(fā)API查詢篩選條件

db.command.eq

查詢篩選條件,表示字段等于某個值。eq 指令接受一個字面量 (literal),可以是 number, boolean, string, object, array, Date。

發(fā)展壯大離不開廣大客戶長期以來的信賴與支持,我們將始終秉承“誠信為本、服務(wù)至上”的服務(wù)理念,堅持“二合一”的優(yōu)良服務(wù)模式,真誠服務(wù)每家企業(yè),認(rèn)真做好每個細(xì)節(jié),不斷完善自我,成就企業(yè),實現(xiàn)共贏。行業(yè)涉及效果圖設(shè)計等,在成都網(wǎng)站建設(shè)成都營銷網(wǎng)站建設(shè)、WAP手機(jī)網(wǎng)站、VI設(shè)計、軟件開發(fā)等項目上具有豐富的設(shè)計經(jīng)驗。

方法簽名:

function eq(value: any): Command

比如篩選出所有自己發(fā)表的文章,除了用傳對象的方式:

const myOpenID = 'xxx'
db.collection('articles').where({
  _openid: myOpenID
})

還可以用指令:

const _ = db.command
const myOpenID = 'xxx'
db.collection('articles').where({
  _openid: _.eq(openid)
})

注意 eq 指令比對象的方式有更大的靈活性,可以用于表示字段等于某個對象的情況,比如:

// 這種寫法表示匹配 stat.publishYear == 2018 且 stat.language == 'zh-CN'
db.collection('articles').where({
  stat: {
    publishYear: 2018,
    language: 'zh-CN'
  }
})
// 這種寫法表示 stat 對象等于 { publishYear: 2018, language: 'zh-CN' }
const _ = db.command
db.collection('articles').where({
  stat: _.eq({
    publishYear: 2018,
    language: 'zh-CN'
  })
})

db.command.neq

表示字段不等于某個值,和 db.command.eq 相反


db.command.lt

查詢篩選條件,表示字段需小于指定值。可以傳入 Date 對象用于進(jìn)行日期比較。

方法簽名:

function lt(value: number | Date): Command

示例代碼

找出進(jìn)度小于 50 的 todo

const _ = db.command
db.collection('todos').where({
  progress: _.lt(50)
})
.get({
  success: console.log,
  fail: console.error
})

db.command.lte

查詢篩選條件,表示字段需小于或等于指定值??梢詡魅?nbsp;Date 對象用于進(jìn)行日期比較。

方法簽名:

function lte(value: number | Date): Command

示例代碼

找出進(jìn)度小于或等于 50 的 todo

const _ = db.command
db.collection('todos').where({
  progress: _.lte(50)
})
.get({
  success: console.log,
  fail: console.error
})

db.command.gt

查詢篩選條件,表示字段需大于指定值??梢詡魅?nbsp;Date 對象用于進(jìn)行日期比較。

方法簽名:

function gt(value: number | Date): Command

示例代碼

找出進(jìn)度大于 50 的 todo

const _ = db.command
db.collection('todos').where({
  progress: _.gt(50)
})
.get({
  success: console.log,
  fail: console.error
})

db.command.gte

查詢篩選條件,表示字段需大于或等于指定值??梢詡魅?nbsp;Date 對象用于進(jìn)行日期比較。

方法簽名:

function gte(value: number | Date): Command

示例代碼

找出進(jìn)度大于或等于 50 的 todo

const _ = db.command
db.collection('todos').where({
  progress: _.gte(50)
})
.get({
  success: console.log,
  fail: console.error
})

db.command.in

查詢篩選條件,表示字段的值需在給定的數(shù)組內(nèi)。

方法簽名:

function in(values: any[]): Command

示例代碼

找出進(jìn)度為 0 或 100 的 todo

const _ = db.command
db.collection('todos').where({
  progress: _.in([0, 100])
})
.get({
  success: console.log,
  fail: console.error
})

db.command.in

查詢篩選條件,表示字段的值需不在給定的數(shù)組內(nèi)。

方法簽名:

function nin(values: any[]): Command

示例代碼

找出進(jìn)度不是 0 或 100 的 todo

const _ = db.command
db.collection('todos').where({
  progress: _.nin([0, 100])
})
.get({
  success: console.log,
  fail: console.error
})


標(biāo)題名稱:創(chuàng)新互聯(lián)小程序教程:微信小程序云開發(fā)API查詢篩選條件
網(wǎng)站網(wǎng)址:http://m.5511xx.com/article/dpoopcj.html