t***@qq.com
t***@qq.com
  • 发布:2025-07-15 09:16
  • 更新:2025-07-15 11:27
  • 阅读:21

【报Bug】unicloud-db 在支付宝云下,where无法使用db.command.exists(false)

分类:uniCloud

产品分类: uniCloud/支付宝小程序云

操作步骤:

-

预期结果:

-

实际结果:

-

bug描述:

同代码下,unicloud-db在阿里云腾讯云下正常。

在支付宝云下
where参数:
type: db.command.or(
db.command.exists(false), //不存在
db.command.eq(0) // 等于 0
)

调试发现db.command.exists(false)没有效果,把type字段设置为int索引也没效果。

2025-07-15 09:16 负责人:无 分享
已邀请:
DCloud_uniCloud_CRL

DCloud_uniCloud_CRL

我测试没有问题呢,我的测试数据:

[  
{ name: "1", type: 0 },   
{ name: "2", type: 1 },  
{ name: "3" }  
]

查询语句:

db.collection('test').where({  
        type: db.command.or([  
            db.command.exists(false),  
            db.command.eq(0)  
        ])  
    }).get()

结果:

{"data":[{"_id":"6875c9dfeee0dd702f64f621","name":"1","type":0},{"_id":"6875c9dfeee0dd702f64f623","name":"3"}]}

要回复问题请先登录注册