7***@qq.com
7***@qq.com
  • 发布:2023-02-27 22:44
  • 更新:2023-02-27 22:44
  • 阅读:311

云数据库查询数组字段,是否包含某个值的问题

分类:uniCloud

假设数据clsaa如下:
{
"_id": "1",
"students": ["li","wang"]
}
{
"_id": "2",
"students": ["wang","li"]
}
{
"_id": "3",
"students": ["zhao","qian"]
}

想要查询出来 students字段中

不包含 "wang" 怎么写?

只查到了包含的写法,如下:
const res = await db.collection('class').where({
students: 'wang'
})
.get()

2023-02-27 22:44 负责人:无 分享
已邀请:

要回复问题请先登录注册