1:修改表列名 把companies表中identification列名修改为status
db.getCollection('companies').update({},{$rename:{'identification':'status'}},false,true)
db.getCollection('companies').update({},{$rename:{'short_name':'shortName'}},false,true)
db.getCollection('companies').update({},{$rename:{'company_intro_text':'companyIntroText'}},false,true)
db.getCollection('companies').update({},{$rename:{'href':'companyLink'}},false,true)
2:删除某一列 删除manager_list 一列
db.getCollection('companies').update({},{$unset:{'manager_list':''}},false, true)
db.getCollection('companies').update({},{$unset:{'lagou_url':''}},false, true)
db.getCollection('companies').update({},{$unset:{'history':''}},false, true)
db.getCollection('companies').update({},{$unset:{'company_img':''}},false, true)
导出一张表
mongoexport --host localhost --port 27017 --username quicktest --password quicktest --collection trans.sp --db quicktest --out trans.sp.json
导出一张表
mongoimport --host localhost --port 27019 --username quicktest --password quicktest --collection trans.sp --db quicktest --file /opt/kdf/trans.sp.json
8710



被折叠的 条评论
为什么被折叠?



