Home > Mobile >  WeChat small program to determine whether the collection contains an element
WeChat small program to determine whether the collection contains an element

Time:11-22

Form to enter a number, to determine whether a number in the cloud database collection?

CodePudding user response:

You can use indexOf

CodePudding user response:

references reply 1/f, cc:
can use indexOf
bb you?? ?

CodePudding user response:

Command. The exists
 
Mand const _=db.com
Db. Collection (' todos.) where ({
Tags: _ the exists (true)
})
.get ({
Success: the console log,
Fail: the console. The error
})

See documentation: https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-sdk-api/database/command/Command.exists.html
  • Related