{$and:[{"flag" :{ $ne:"1"}},{"flag" :{ $ne:"0"}}]}  // flag不等于1 也不等于0
{$or:[{"flag" :{ $ne:"1"}},{"flag" :{ $ne:"0"}}]}  // flag不等于1 或者不等于0
db.xx_spider_agent.update({'tag':'111'},{$set:{'tag':'0'}},{multi:true})

db.wuba_SaleHouseList_20180716.aggregate([{$group : {_id : "$city", num_tutorial : {$sum : 1}}}]) = select city,count(*) from wuba_SaleHouseList_20180716 group by city 常规的聚合统计

db.anjuke_houseranking_20180717120000.aggregate([{$group : {_id : {name:"$city",st:"$type"}, count : {$sum : 1}}}]) = select city,type,count(*) from wuba_SaleHouseList_20180716 group by city ,type

db.lianjia_showlooks.find({"showings":{$type:16}}).forEach(function(x){x.showings=String(x.showings);db.lianjia_showlooks.save(x)}) 替换int类型的字段为String 类型

db.wuba_houseranking_20180913140000.aggregate([
{$group:{"_id": { "city" : "$city", "type": "$type",} ,"number":{$sum:1}}},
{$project:{"_id": false, "city" : "$_id.city", "type" : "$_id.type","number" : true}},
{$sort:{"number":-1}},
])

 

db.xms_orgID.updateMany({},{$set:{"tag":"1"}})

 

相关文章:

  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-24
  • 2021-05-21
  • 2021-07-06
  • 2022-12-23
  • 2021-11-15
相关资源
相似解决方案