Created
September 30, 2019 07:52
-
-
Save PoplarYang/464437a6322053e4f5a5f73875eaac5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongoimport --host --port --db --collection | |
mongoimport --mode upsert --host dora1 --port 26011 --db boots --collection flavor --file test.json | |
-h,--host :代表远程连接的数据库地址,默认连接本地Mongo数据库; | |
--port:代表远程连接的数据库的端口,默认连接的远程端口27017; | |
-u,--username:代表连接远程数据库的账号,如果设置数据库的认证,需要指定用户账号; | |
-p,--password:代表连接数据库的账号对应的密码; | |
-d,--db:代表连接的数据库; | |
-c,--collection:代表连接数据库中的集合; | |
-f, --fields:代表导入集合中的字段; | |
--type:代表导入的文件类型,包括csv和json,tsv文件,默认json格式; | |
--file:导入的文件名称 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment