skip to Main Content

why is mongoose not finding my data in mongodb

I have the following schema: const mongoose = require("mongoose"); const { ObjectId, Number } = mongoose.Schema.Types; const CategoriesSchema = new mongoose.Schema( { name: { type: String, required: true, }, img: { type: String, required: true, } } ); mongoose.model("Categories", CategoriesSchema,…

VIEW QUESTION

Mongodb – MongooseError: Operation `users.insertOne()` buffering timed out after 10000ms at Timeout. Error?

const mongoose = require("mongoose") mongoose.connect("mongodb://localhost:27017/testdb") const userSchema = new mongoose.Schema({ name : String, age : Number }) const User = mongoose.model("User", userSchema); const user1 = new User({name: "Jack", age: 24}); user1.save().then(() => console.log("User Saved")); I was trying to perform CRUD…

VIEW QUESTION
Back To Top
Search