#!/bin/bash
dbhost="127.0.0.1:27082"
dbname="extract_v3"
datapath="/opt/soft/mongodb/mongodb3.4/bin"
tables=(address areacode audit block_classify block_classify_info block_classify_tag block_info citys classify cleanup fields infoclass infotype memu menusecond pkg_info pkg_logicore postcode province postcode rc_calss rc_field rc_rule rule_back rule_code rule_logic rule_logicback rule_logicore rule_logicpre rule_pre site site_management site_rule_code site_rule_logic site_rule_logicback site_rule_logickv site_rule_logicore site_versioninfo tag tagdetailinfo user version versioninfo)

for i in "${!tables[@]}"; 
do
    ./mongodump -h "$dbhost" -d "$dbname" -c "${tables[$i]}" -o "$datapath"
    printf "export：%s\t%s\n" "$i" "${tables[$i]}"    
done
