What do you want to save?
Add Code snippet
New code examples
-
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 2022-01-30 23:12:02
mongodb database pooling
import mongoose from 'mongoose' mongoose.connect(process.env.MONGO_URI, { minPoolSize: 1, maxPoolSize: 20, compression: { compressors: ['zlib'] }, useUnifiedTopology: true, useNewUrlParser: true, useFindAndModify: false, socketTimeoutMS: 6... Add solution -
Javascript 2022-01-22 02:00:14
DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor
mongoose.connect(mongoConnectionString, {useNewUrlParser: true, useUnifiedTopology: true}); Add solution -
Javascript 2021-11-21 13:30:35
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"... Add solution -
Javascript 2021-11-20 18:44:23
How to connect mongoDB using mongoose
import mongoose from 'mongoose' export const connectDb = async () => { try { await mongoose.connect('mongodb://localhost:27017/test', { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, }) } catch (er... Add solution -
Javascript 2021-11-17 19:14:11
how to connect to mongoose and create a model
const express = require('express'); const app = express(); const mongoose = require('mongoose'); const bodyParser = require('body-parser'); app.use(bodyParser.json()); const PORT = process.env.PORT || 3000; //connecting to db try { mongoose.conne... Add solution