150道前端高頻算法題講解視頻
能有一個(gè)
先查詢
t.find()
{ "_id" : ObjectId("4b977152c9ccb74"), "title" : "ABC", "comments" : [ { "by" : "joe", "votes" : 3 }, { "by" : "jane", "votes" : 7 } ] }
更新
t.update( {'comments.by':'joe'}, {$inc:{'comments.$.votes':1}}, false, true )再查詢
t.find() { "_id" : ObjectId("4bb74"), "title" : "ABC", "comments" : [ { "by" : "j
標(biāo)簽: