Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

mongoose connect to URL of atals

try {
  mongoose.connect(MONGODB_URI || 'mongodb://localhost/YOUR_DB_NAME', {
      useNewUrlParser: true,
      useUnifiedTopology: true
    }, () =>
    console.log("connected"));
} catch (error) {
  console.log("could not connect");
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: joi enum validation 
Javascript :: vuejs send required props to dynamic component 
Javascript :: datatable numeric format 
Javascript :: check if a class exists javascript 
Javascript :: map images from folder react 
Javascript :: javascript location redirect 
Javascript :: redirect react js 
Javascript :: redirect through javascript 
Javascript :: display none javascript 
Javascript :: js get distinct values from array 
Javascript :: get the id of a div in jquery 
Javascript :: js test if i am in iframe 
Javascript :: javascript date get minutes with leading zero 
Javascript :: disemvowel trolls codewars javascript 
Javascript :: hello world in jsp 
Javascript :: document selector query change value 
Javascript :: Days remaining using moment 
Javascript :: check if string is valid date 
Javascript :: js absolute value 
Javascript :: javascript adding delay 
Javascript :: disable text selection in js 
Javascript :: httpget javascript 
Javascript :: js set url params 
Javascript :: gulp del 
Javascript :: get request react 
Javascript :: js scrollintoview 
Javascript :: vuejs set 
Javascript :: js array sum 
Javascript :: how to set height of material ui dialog react 
Javascript :: split a message 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =