skip to Main Content

no socket io connection being made – Reactjs

All versions installed of socket.io and socket.io-client are the same in my mern app. Here is my server code: const app = express(); mongoose.connect(MONGOOSE_URL, { useNewUrlParser: true, useUnifiedTopology: true, }).then(() => { console.log(`MongoDB connected successfully`); }).catch((error) => console.log(`${error} did not…

VIEW QUESTION

Unable to connect to route with express js – Javascript

Trying to connect the API through Route is not responding , Getting the status error: "not connected" restaurants.route.js Integrated The Route Here import express from "express" const router = express.Router() router.route('/api/v1/restaurants').get((req,res) => res.send("helloworld")) export default router index.js Connect to MongoDB.…

VIEW QUESTION

Mongodb – how to mongoose delete cascade in latest version of mongoose without model.remove()?

Not able to delete cascade as Model.remove() fuction is not available in mongoose. using findByIdAndDelete is not invoking the middleware: BootcampSchema.pre('remove',async function(next){ //before deleting the doc console.log(`courses being removed from bootcamp ${this._id}`); await this.model('Course').deleteMany({bootcamp:this._id}); next(); }); tried different delete methods…

VIEW QUESTION
Back To Top
Search