奔跑吧阿虎
奔跑吧阿虎
  • 发布:2025-09-22 19:53
  • 更新:2025-09-22 19:53
  • 阅读:11

【报Bug】支付宝云在修改时,如果原字段是null,则无法修改成功,查询为null数据也无效

分类:uniCloud

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

示例代码:
// bug 1  
db.collection('edu_question').where({  
    answer_video:dbCmd.eq(null)  
}).field("_id,answer_video").get()  

// bug2  
db.collection(dbName).doc(_id).updateAndReturn({  
                title,  
                knowledge_id,  
                subject,  
        stage,  
                question_type,  
                question_content,  
                options,  
                correct_answer,  
                answer_image,  
                answer_video,  
                related_video_id,  
                difficulty,  
                status,  
                create_by,  
                create_time,  
                update_by,  
                update_time  
        });  

// bug2 另外一种写法  

db.collection('edu_question').doc("68cbad06d3f484b4ddc4e120").update({  
"answer_video": {  
            "cloudPath": "1758516601487_0.mp4",  
            "extname": "mp4",  
            "fileID": "cloud://env-ttttttttt/1/2/68d0d163a0bcbf02418ddd65/q/06832579362276925_1758516601490_0.mp4",  
            "fileType": "video",  
            "name": "这个题目没有上传.mp4",  
            "path": "https://env-ttttttt.normal.cloudstatic.cn/1/2/68d0d163a0bcbf02418ddd65/q/06832579362276925_1758516601490_0.mp4?expire_at=1758517201&er_sign=32430614eb59ccb8a4c1366349da9f31",  
            "size": 1317328,  
            "status": "success",  
            "url": "https://env-ttttttt.normal.cloudstatic.cn/1/2/68d0d163a0bcbf02418ddd65/q/06832579362276925_1758516601490_0.mp4?expire_at=1758517201&er_sign=32430614eb59ccb8a4c1366349da9f31",  
            "uuid": 1758516601488  
        }  
}  
)  

// 修改后,answer_video 依然是null  
// 提示信息为 更新完成,更新条数为0,请求耗时...  

操作步骤:

如图所示

预期结果:

如图所示

实际结果:

如图所示

bug描述:

前提:
字段answer_video 为Object类型

BUG1 :
查询某个字段为null的数据,结果查询出所有数据
db.collection('edu_question').where({
answer_video:dbCmd.eq(null)
}).field("_id,answer_video").get()

BUG2:
使用update修改时,如果某个数据(answer_video)在修改前的值是null, 那么无论如何都无法修改成功。

2025-09-22 19:53 负责人:无 分享
已邀请:

要回复问题请先登录注册