mongoDb数据库修改数据时出现错误

浏览:3250 发布日期:2018/07/09 分类:ThinkPHP5专区 关键字: Tp5.1 mongo 修改数据
在使用mongo扩展修改数据时:提示
Performing an update on the path '_id' would modify the immutable field '_id'错误.
配置文件把_id修改为了id
修改语句为:
$mongo->name('common_amount')->where('id',$id)->update(['status'=>1]);
但是使用下查询语句时正式,没有错误返回:
$mongo->name('common_amount')->where('id',$id)->find();
最佳答案
评论( 相关
后面还有条评论,点击查看>>