#count Collection
Db.news.count ({"Lpublishtime": {"$gte": 1358697600000}});
#mongo导出
Mongoexport-h 192.168.1.175--port 33000-d booaa_so-c weibo-f ' _id '-Q ' {\ ' lweibotime\ ': {\ "\ $gte \": 1349020800000,\ "\ $l T\ ": 1351699200000}}"-O Weibo_20121201_33000.ids &
##################### #20121227. txt######################
#mongo导出0.1
Mongoexport--port 33000-d booaa_so-c bbs-f ' _id '-o 33000.bbs.ids;
#替换, replace the exported file contents with an INSERT SQL statement
#sed v1
Sed ' s/{' _id: {"\ $oid":/insert ignore into index_quene3_test (id,createtime) VALUES (/' 33001.bbs.ids> 33001.bbs. Ids_tmp
Sed ' s/}}/,now ()); 33001.bbs.ids_tmp> 33001.bbs.ids_final
#sed v2
Sed ' s/{' _id ": {" \ $oid ":"//' 20130121_33002_bbs.ids> 20130121_33002_bbs.ids_tmp
Sed ' s/'}}//' 20130121_33002_bbs.ids_tmp> 20130121_33002_bbs.ids_final
#sed 3
Sed ' s/insert into Index_quene/insert ignore into index_quene/' 33001.weibo.ids_final> 33001.weibo.ids_fffff
#mysql导入
#2013 -01-12 Import
Mysql-um4n-p01d060a476642ba8335b832ac5b211f222f641b5-h192.168.1.136-d boss_db < 33002.bbs.ids_final &
Mysql-um4n-p01d060a476642ba8335b832ac5b211f222f641b5-h192.168.1.136-d boss_db < 33002.blog.ids_final &
#统计文件行数数量
[Email protected] ~]$ wc-l weibo_20130121_33002.ids_final
4942900 weibo_20130121_33002.ids_final
#index_module MV
MV busstmp/weibomerge/weibo0/* buss/weibo0/
MV busstmp/weibomerge/weibo1/* buss/weibo1/
#mysql SQL Import
Insert Ignore to Index_quene4 (id,createtime) select Id,createtime from Index_quene4_test;
MongoDB ID Export, dump,sed,count,mysql import, etc. usage examples