最近....
#设置用户名密码
db.createUser({user: 'root', pwd: '123456', roles: ['root']})
#开启认证
nohup mongod --auth -f /etc/mongod.conf&
#导出yapi
mongodump -h localhost -d yapi -o dump
#导入yapi
mongorestore -h xxxxxx -d yapi dumpyapi
#from mongod 4 --> mongod 3
/usr/local/mongo/bin/mongorestore -h 127.0.0.1 -d yapi dump/yapi --noIndexRestore
https://docs.mongodb.com/manual/reference/program/mongorestore/#cmdoption--noIndexRestore