Last active
September 18, 2016 02:40
-
-
Save aNd1coder/761a5b2b1a3695c65096302d78b2ea62 to your computer and use it in GitHub Desktop.
MongoDB 常用工具
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 新增字段 */ | |
db.getCollection('collection_name').update({},{$set:{'field_name':'xxx'}},false,true) | |
/* 删除字段 */ | |
db.getCollection('collection_name').update({},{$unset:{'field_name':''}},{multi:true}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment