mongo导入CSV文件数据
//链接数据库
./mongo
//切换数据库
use 数据库名称
例:use gcn
//查看所有表名
show collections
//导入CSV文件到数据库
./mongoimport -h IP地址:端口号 -d "数据库名" -c "表名" -f "字段1,字段2" -type=文件类型 -file=文件路径
例:./mongoimport -h lcoalhost:27017 -d "gcn" -c "cktest" -f "AREA,PERIMETER,RES1_4M_" -type=csv -file=/home/res1_4m.csv
//查询数据
db.表名.find()
例:db.cktest.find()

浙公网安备 33010602011771号