【MongoDB】mongoimport mongoexport
来源:互联网 发布:js 动态仪表盘 编辑:程序博客网 时间:2024/05/20 06:41
mongoexport:将数据导出成JSON格式,与标准的JSON有些不同
参数说明:
[root@localhost mongodb]# ./bin/mongoexport –help
Export MongoDB data to CSV, TSV or JSON files.
options:
–help produce help message
-v [ –verbose ] be more verbose (include multiple times for more verbosity e.g. -vvvvv)
–version print the program’s version and exit
-h [ –host ] arg mongo host to connect to ( /s1,s2 for sets)
–port arg server port. Can also use –host hostname:port
–ipv6 enable IPv6 support (disabled by default)
-u [ –username ] arg username
-p [ –password ] arg password
–dbpath arg directly access mongod database files in the given
path, instead of connecting to a mongod server -
needs to lock the data directory, so cannot be used
if a mongod is currently accessing the same path
–directoryperdb if dbpath specified, each db is in a separate directory
–journal enable journaling
-d [ –db ] arg database to use
-c [ –collection ] arg collection to use (some commands)
-f [ –fields ] arg comma separated list of field names e.g. -f name,age
–fieldFile arg file with fields names - 1 per line
-q [ –query ] arg query filter, as a JSON string
–csv export to csv instead of json
-o [ –out ] arg output file; if not specified, stdout is used
–jsonArray output to a json array rather than one object per line
-k [ –slaveOk ] arg (=1) use secondaries for export if available, default true
常用: mongoexport -d testdb -c testcol -o out.dat
mongoimport:从JSON导入,由于与标准的JSON略有些不同,如果出现错误,可以先导出看看mongo的格式要求,再导入
[root@localhost mongodb]# ./bin/mongoimport –help
options:
–help produce help message
-v [ –verbose ] be more verbose (include multiple times for more verbosity e.g. -vvvvv)
–version print the program’s version and exit
-h [ –host ] arg mongo host to connect to ( /s1,s2 for sets)
–port arg server port. Can also use –host hostname:port
–ipv6 enable IPv6 support (disabled by default)
-u [ –username ] arg username
-p [ –password ] arg password
–dbpath arg directly access mongod database files in the given
path, instead of connecting to a mongod server -
needs to lock the data directory, so cannot be used
if a mongod is currently accessing the same path
–directoryperdb if dbpath specified, each db is in a separate directory
–journal enable journaling
-d [ –db ] arg database to use
-c [ –collection ] arg collection to use (some commands)
-f [ –fields ] arg comma separated list of field names e.g. -f name,age
–fieldFile arg file with fields names - 1 per line
–ignoreBlanks if given, empty fields in csv and tsv will be ignored
–type arg type of file to import. default: json (json,csv,tsv)
–file arg file to import from; if not specified stdin is used
–drop drop collection first
–headerline CSV,TSV only - use first line as headers
–upsert insert or update objects that already exist
–upsertFields arg comma-separated fields for the query part of the upsert. You should make
sure this is indexed
–stopOnError stop importing at first error rather than continuing
–jsonArray load a json array, not one item per line. Currently limited to 4MB.
- 【MongoDB】mongoimport mongoexport
- mongodb数据导入导出mongoexport/mongoimport
- 【MongoDB】mongoimport and mongoexport of data (一)
- 【MongoDB】mongoimport and mongoexport of data (二)
- MongoDB:8-MongoDB的导入(mongoimport)和导出(mongoexport)
- Mongodb数据导出命令mongoexport和导入命令mongoimport介绍
- Mongodb数据导出工具mongoexport和导入工具mongoimport介绍
- Mongodb数据导出工具mongoexport和导入工具mongoimport介绍
- Mongodb数据导出工具mongoexport和导入工具mongoimport介绍
- Mongodb数据导出工具mongoexport和导入工具mongoimport介绍
- Mongodb数据导出工具mongoexport和导入工具mongoimport介绍
- Mongodb数据导出工具mongoexport和导入工具mongoimport介绍
- Mongodb数据导出工具mongoexport和导入工具mongoimport介绍
- Mongodb数据导出工具mongoexport和导入工具mongoimport介绍
- Mongodb数据导出命令mongoexport和导入命令mongoimport介绍
- mongoexport和mongoimport
- Mongodb数据处理(备份mongodump、恢复mongorestore、导入mongoimport、导出mongoexport)
- Mongodb数据 导入导出数据 导出工具mongoexport和导入工具mongoimport介绍
- iptables不完全手册
- 拥塞控制之慢开始和拥塞避免
- Java-按指定顺序执行线程
- Leetcode 239 Sliding Window Maximum
- 排序算法
- 【MongoDB】mongoimport mongoexport
- Powershell调用Excel批量读取指定单元格数据并输出csv结果文件
- 【MongoDB】mongo复制数据库和集合
- win10桌面图标和菜单栏不时的闪烁问题
- ubuntu14.04安装node+grunt
- Activity中的数据传递
- java字符串大小写转化
- 康托展开
- php redis mongo python 数据类型小结