Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ async function run() {
// a valid username and password! Note that in a production environment,
// you do not want to store your password in plain-text here.
const uri =
"mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { MongoClient, ServerApiVersion } = require('mongodb');
const uri = "mongodb+srv://izzaddinid_db_user:N6sF8ep2jnnUqi22@cluster0.grqelpv.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0";

// Create a MongoClient with a MongoClientOptions object to set the Stable API version
const client = new MongoClient(uri, {
serverApi: {
version: ServerApiVersion.v1,
strict: true,
deprecationErrors: true,
}
});

async function run() {
try {
// Connect the client to the server (optional starting in v4.7)
await client.connect();
// Send a ping to confirm a successful connection
await client.db("admin").command({ ping: 1 });
console.log("Pinged your deployment. You successfully connected to MongoDB!");
} finally {
// Ensures that the client will close when you finish/error
await client.close();
}
}
run().catch(console.dir);

"mongodb+srv://<aapkasubroto>:<x7yw9HSOYVj2eN2i>@<cluster-url>?retryWrites=true&w=majority";

// The MongoClient is the object that references the connection to our
// datastore (Atlas, for example)
Expand Down