[ 笔记列表 ]
所属分类:null
浏览:74
内容:
操作系统 Linux Centos-7.9 官网下载: https://www.mongodb.com/try/download/database-tools?tck=docs_databasetools 选择对应的版本 mongodb-database-tools-rhel70-x86_64-100.5.4.tgz 官网下载网址: https://fastdl.mongodb.org/tools/db/mongodb-database-tools-rhel70-x86_64-100.5.4.tgz 官网文档网址: https://www.mongodb.com/docs/database-tools/ https://www.mongodb.com/docs/database-tools/installation/installation-linux/ https://www.mongodb.com/docs/database-tools/mongoimport/ https://www.mongodb.com/docs/database-tools/mongoexport/ [root@local] wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-rhel70-x86_64-100.5.4.tgz [root@local] tar -zxvf mongodb-database-tools-rhel70-x86_64-100.5.4.tgz [root@local] mv mongodb-database-tools-rhel70-x86_64-100.5.4 /opt/soft/mongodb-tools 执行导出命令 [root@local] /opt/soft/mongodb-tools/bin/mongoexport --uri="mongodb://local:3717/?authsource=test-source" --username="test-user" --password="123456" --authenticationMechanism="SCRAM-SHA-1" --type="csv" --fields="f1,f2,f3,f4,f5" -d="test-db" -c="test-collect" -o="/tmp/tmp_data/export-data.csv" --noHeaderLine [root@local] cat /tmp/tmp_data/export-data.csv
链接:
|