Skip to content

Instantly share code, notes, and snippets.

@anhquoc1104
Last active May 25, 2020 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anhquoc1104/521e98d802a1fde7cba11833989b0194 to your computer and use it in GitHub Desktop.
Save anhquoc1104/521e98d802a1fde7cba11833989b0194 to your computer and use it in GitHub Desktop.
### Create new account in Mongo Atlas
### New Cluster
### Databases Access : New User and role user
### Network Access : Add ip
### Connect with appNodeJS using mongoose:
const mongoose = require('mongoose');
const url = "mongodb+srv://<username>:<password>@<nameCluster>-ie3x8.gcp.mongodb.net/<DBname>?retryWrites=true&w=majority"
mongoose.connect(url, {useNewUrlParser: true, useUnifiedTopology: true});
...Using...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment