Skip to content

Instantly share code, notes, and snippets.

@NielsMinssen
Last active May 12, 2023 14:30
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 NielsMinssen/1155e90ca93bc11f4d3b4f8269fd3974 to your computer and use it in GitHub Desktop.
Save NielsMinssen/1155e90ca93bc11f4d3b4f8269fd3974 to your computer and use it in GitHub Desktop.
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