#!/bin/bash
dbhost="127.0.0.1:27082"
dbname="extract_v3"
datapath="/opt/soft/mongodb/mongodb3.4/bin"
tables=(audit citys classify cleanup fields province rc_calss rc_field rc.order rc_rule rule_back rule_code rule_logic rule_logicback rule_logicore rule_logicpre rule_pre tag tagdetailinfo 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
