shell script - application about loops

array=('Brand' 'BrandInfo' 'BrandBaojia' 'VehicleType' 'BrandBaoyang' 'Youhui' 'Config' \
'Comment' 'OwnerPrice' 'Article' 'UsedCar' 'Video' 'MallGCT' 'MallImport' \
'Baike' \
'MachineOil'\
 ' Tire ' \
 ' Yanghu ' \
 ' Chepin ' \
 ' Product ' \
 ' NewCar ' \
 ' Daogou ' \
 ' Tech ' \
 ' Pingce ' \
 ' Hangjia ' \
 ' Picture ' \
 ' Gaizhuang ' \
 ' Hangye ' \
 'MotoSport ' \
 'Culture' \
'Keji' \
'Chedai' \
'Hangqing' \
'BrandDealer' \
'DealerIndex' \
'Dealer' \
'DealerOther' \
'DealerNews' \
'DealerModel' \
'DealerMarket' \
'DealerContact' \
'DealerOtherPrice' \
)

for var in ${array[@]}
do
    mongoexport -d PCauto_tit -c $var -o $var.txt
done

echo '------------ finished export ---------------'

Use the shell script to export each table in the PCauto_tit library in mongodb as a txt file named after each table name.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325221473&siteId=291194637