- 更新某个字段
db.getCollection('global_feed_view').update(
// query
{
"key" : "myyule_feed_blog"
},
// update
{
$set:{"list":["56c5a1a984ae83835d4fb307"]}
},
// options
{
"multi" : false, // update only one document
"upsert" : false // insert a new document, if no existing document match the query
}
);
2 . 更新某一字段为int类型
$set:{"followerCount":NumberInt(0)}