要求:获取所有点 < 90 的文档,并将“点”增加 +20 数据:
{ "_id" : 1, "student" : 1, "type" : "exam", "point" : 115 }
{ "_id" : 2, "student" : 2, "type" : "exam", "point" : 85 }
{ "_id" : 3, "student" : 3, "type" : "exam", "point" : 115 }
Query tried :
// query below
db.points.update({},{$inc:{point:20},point:{lt:110}},{multi:true})
On executing : fn[0] == '$'is seen and query has not affected any changes.