Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

connect mongoose to atlas

const mongoAtlasUri =
  "mongodb+srv://username@gmail.com:password@cluster0.mkb94.mongodb.net/DB_NAme?retryWrites=true&w=majority";

try {
  // Connect to the MongoDB cluster
  mongoose.connect(
    mongoAtlasUri,
    { useNewUrlParser: true, useUnifiedTopology: true },
    () => console.log(" Mongoose is connected")
  );
} catch (e) {
  console.log("could not connect");
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: window.onload 
Javascript :: automatically add typedef to module.exports vscode site:stackoverflow.com 
Javascript :: run react app in different port 
Javascript :: node version not specified in package.json 
Javascript :: remove tr in table jquery 
Javascript :: JS get length of an object 
Javascript :: how to submit using checkbox 
Javascript :: javascript setinterval 
Javascript :: install emailjs npm 
Javascript :: hello world jquery 
Javascript :: js input trigger change event when set value with js 
Javascript :: check email js 
Javascript :: jquery clear select 2 
Javascript :: javascript base64 encode string 
Javascript :: javascript how to get a random element from an array 
Javascript :: select all children javascript 
Javascript :: add select option javascript 
Javascript :: break camelcase codewars 
Javascript :: check if array javascript 
Javascript :: cypress set viewport 
Javascript :: react style justify content space between 
Javascript :: Exceeded maximum budget Budget 10 kB was not met by 478 bytes with a total of 10.5 kB. 
Javascript :: three.js sphere 
Javascript :: yarn add material ui 
Javascript :: console.log formdata 
Javascript :: onMounted 
Javascript :: get only numbers regex javascript 
Javascript :: chartjs start at 0 
Javascript :: how to get random boolean in javascript 
Javascript :: rm rf node modules 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =