What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-02 14:15:03
ssh tunnel connect to mongodb in node.js
var config = { username:'myusername', host:'my.ip.address', agent : process.env.SSH_AUTH_SOCK, privateKey:require('fs').readFileSync('/Users/myusername/.ssh/id_rsa'), port:22, dstPort:27017, password:'mypassword' }; var server... Add solution -
Html 2022-02-18 02:55:08
what is Mongoose
import express from 'express'; or const exporess = require('express'); import mongoose from 'mongoose'; or const mongoose = require('mongoose'); const app = express(); mongoose.connect('mongodb://localhost:27017/mongo-tree' , { useNewUrlParser: true, ... Add solution -
Javascript 2021-10-30 03:37:12
connecting to mongoDB using mongoose
//Import the mongoose module var mongoose = require('mongoose'); //Set up default mongoose connection var mongoDB = 'mongodb://127.0.0.1/my_database'; mongoose.connect(mongoDB, {useNewUrlParser: true, useUnifiedTopology: true}); //Get the default connec... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5