The sample of springboot use mongodb datasource
brew install mongodb
sudo mkdir -p /data/db
sudo chown -R $USER /data/db
mongoimport --db movie --collection douban --file /Users/anany/Downloads/douban.json
终端进入 MongoDB ,创建用户
>mongod
>use movie
>db.createUser({
user:'anany',
pwd:'273082671',
roles:[
{role:'readWrite',db:'movie'}
]
})
编辑位于 /usr/local/etc/mongod.conf,添加: security: authorization: enabled
mongod --auth