arr:[{
name: 'item-1',
},{
name: 'item-2',
}]
}
{
arr:[{
name: 'item-3',
},{
name: 'item-4',
}]
}
const res = await db.collection('test').where({
'arr.0.name': 'item-1'
})
这个代码可以正常查询第一个位置如果为item-1就返回预期值
const res = await db.collection('test').where({
'arr.name': 'item-1'
})
这样就不行了 阿里云OK 支付宝云不行



x***@163.com (作者)
您好 添加以后还是不可以 我重新建立了一个表 添加好array的索引后也不可以...
2025-10-29 13:27
x***@163.com (作者)
回复 x***@163.com: 我在楼下贴了控制台的索引和数据库的数据结构,请帮忙看看 感谢
2025-10-29 13:33