您的位置:首页 > 数据库 > Mongodb

mongodb常用语句

2017-07-28 15:32 399 查看
更新某个字段

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)}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: