Saturday 7 July 2018

mongoDB Atlas tutorial



create cluster, project, 500Mb free tier available with AWS

in cluster security, add user, assign permision

in cluster security, ip whitelist, add 0.0.0.0 to allow all server access

connect cloud with your app, replace user and password in connection string
download mongoose, npm install mongoose
mongoose.connect('mongodb+srv://USER:PASSWORD@transactionpaper-taxad.mongodb.net/test?retryWrites=true');

connect to cloud with mongoCompass, download mongoCompass, click connect->connect to
copy connection string form cloud, mongoCompass auto pick up host name, edit user, password
connection string: mongodb+srv://viewer:aaabbbccc@transactionpaper-taxad.mongodb.net/admin

mongoCompass default name cloud cluster test, collections in test cluster can be managed and saved on cloud.


reference:
mongoose:
port: localhost:4000
http://mongoosejs.com/docs/index.html

No comments:

Post a Comment