mongoimport -d数据库名称 -c 集合名称 --file 要导入的数据文件
需要将命令所在的目录添加到环境变量中
1、找到mongodb数据库的安装目录。将安装目录下的bin目录方式在path环境变量中
C:\Program Files\MongoDB\Server\4.2\bin
mongoimport --authenticationDatabase admin -u root -p root -d playground -c users1 --file ./user.json
新增的
mongoexport --authenticationDatabase admin -u root -p root --host 127.0.0.1 --port 27017 --db blog --collection articles --out D:/test/ceshi.json
导出成功
本文地址:https://blog.csdn.net/Gy_9543/article/details/107654932
如对本文有疑问, 点击进行留言回复!!
express+mongoose实现对mongodb增删改查操作详解
修复 Mac brew 安装 mongodb 报 Error: No available formula with the name ‘mongodb’ 问题详解
网友评论