db.re_local_stars.update({$where:function(){
for(var current in this){
for(var other in this){
if(current != other && this["name"] == this["cname"]){
return true;
}
}
}
return false;
}},{$set:{country:"xxx"}},{
multi: true,
})
db.re_local_stars.update({$where:function(){
for(var current in this){
for(var other in this){
if(current != other && this["name"] == this["cname"]){
return false;
}
}
}
return true;
}},{$set:{country:"xxx"}},{
multi: true,
})
mongodb搜索两个字段值相同的记录
猜你喜欢
转载自blog.csdn.net/moliyiran/article/details/104099213
今日推荐
周排行