Hi guys,
As you know that mlab.com now is a part of MongoDB atlas, also the connection from Sails Js apps to MongoDB has to change to adapt new connection info (cluster) using sails-mongo (versions:^1.2.0")
I'll go through the steps on how to create a cluster on Mongodb.com I think it very easy.
Okay let's go to config
Step 1: After the Cluster created you need to go to the cluster detail, look below you can see we have 1 primary cluster and two secondary clusters.
Let go through each cluster and copy each shared cluster URL to note, we'll use it for config next step;
Step 2: Config data store for Sails Js, let config like below
url:'mongodb://user:pass@url of shared cluster primary,URL of shared cluster secondary/database name',
replicaSet: see in the detailed cluster page to set your correct replica Set
authSource:"admin"
adapter: 'sails-mongo',
url:'mongodb://usersample:passsample@clusterprimary-shard-00-00.abcd.mongodb.net:27017/sampledb',
ssl: true ,
replicaSet:'atlas-sample-shard-0',
authSource:'admin',
That's all config if you have any question please contact me via FB: https://www.facebook.com/leo.trinh.6890/




![[Excel] Hướng dẫn diệt Virus macro tự nhân bản files](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjT1rmpnZOcKEwLJHevdkPehl-sRUcIkERBdErlxsldsMjzQurFbrMGNvOfwMT8SNqR9V1K_9N5L_B15c3Xx0AN0bC-Welh8-S3qBV8IhHROK1nCgzdlpiy7ulrcV6OV9GrdraNKi_kYGMm/s72-c/virus-excel-macro-kangatang.jpg)

Không có nhận xét nào:
Đăng nhận xét