基于centos
sudo yum install -y mongodb-org
如果 找不到 repo、执行一下操作
vi /etc/yum.repos.d/mongodb-org-3.4.repo
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
{ user: "<name>",
pwd: "<cleartext password>",
customData: { <any information> },
roles: [
{ role: "<role>", db: "<database>" } | "<role>",
...
]
}
read
readWrite
dbAdmin
dbOwner
userAdmin
…
Removes the current database.
Copies a remote database to the current database. The command assumes that the remote database has the same name as the current database.