Last active
September 18, 2020 03:37
-
-
Save Hfreitas/be7a771c1e118e31ecdb4dacbacadd17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MongoClient = require('mongodb').MongoClient; | |
const uri = "mongodb+srv://masterUser:<password>@myfirstdb.7vxnx.gcp.mongodb.net/<dbname>?retryWrites=true&w=majority"; | |
const client = new MongoClient(uri, { useNewUrlParser: true }); | |
client.connect(err => { | |
const collection = client.db("test").collection("devices"); | |
// perform actions on the collection object | |
client.close(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment