Back

使用mongoexport 按条件导出数据 (export mongo database by search conditions)

发布时间: 2013-11-14 08:16:00

referred post: http://www.glenscott.co.uk/blog/exporting-a-single-document-from-mongodb/

简单的说: (long in short) 

导出:  / export: 

$ mongoexport -d 'm_video_fetcher_production' -c 'plans' -q '{cms_category_class: /IphoneSubChannel/}' -o ios_sub_channel_plans.js -p

导入: / import 

$ mongoimport -p -d 'm_video_fetcher_real_production' -c 'plans' ios_sub_channel_plans.js

Back