-
-
Save NielsMinssen/1155e90ca93bc11f4d3b4f8269fd3974 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 url = 'mongodb://localhost:27017'; | |
const dbName = 'db'; | |
MongoClient.connect(url, function(err, client) { | |
console.log("Connecté à la base de données"); | |
const db = client.db(dbName); | |
// Interagir avec la base de données ici | |
client.close(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment