var ones = db.Photo.find({‘owner.$id‘:ObjectId("5344f0dab7c58e8e098b4567")})
db.Photo.find({‘owner.$id‘:ObjectId("5344f0dab7c58e8e098b4567")}).forEach(function(o){o.owner=null;db.Photo.save(o)});
mongo里面根据对象字段的ID查询 db.Photo.find({'owner.$id':ObjectId('xxxx')}) , 并且使用forEach循环修改查询的数据
原文地址:http://www.cnblogs.com/vincedotnet/p/3916176.html