Created
May 18, 2023 15:48
-
-
Save parkerfoshay/334ebbea2bf116c2e0f15d8ffd2017ab to your computer and use it in GitHub Desktop.
node_12_app
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
{ | |
"name": "node_12", | |
"version": "1.0.0", | |
"description": "", | |
"main": "desk.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start": "node server.js" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"mongodb": "^3.1.13" | |
} | |
} |
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'); | |
const uri = ""; | |
const client = new MongoClient(uri); | |
client.connect((err) => { | |
const collection = client.db("sample_supplies").collection("sales"); | |
console.log("err"); | |
collection.findOne({}).then((sale) => { | |
console.log(sale); | |
}); | |
client.close(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment