我想实现类似如下SQL语句的效果:
select * from todos where todos.groupid='123' and (todos.visiable='0' or todos._openid='abc')
请问使用云开发数据库查询该怎么写?看官方文档,尝试以下写法没有达到想要的效果
db.collection('todos').where(_.and([
{groupid: 'f6e******c6'},
_.or({visiable: _.eq("0")}),
_.or({_openid: 'ohwI****K4'})
])).get()
这样可以
db.collection('todos').where(_.and([
{
groupid: 'f6e******c6',
},
_.or([
{visiable: '0'},
{_openid: 'ohwI****K4'}
])
])).get()