Category "mongoose"

Error: querySrv ESERVFAIL _mongodb._tcp.cluster0.abcd0.mongodb.net

My nodejs app was working fine with mongodb connection and suddenly this error got appeared. Then I tried to connect to mongodb with mongo compass and same erro

How to use two schemas to create two collections in mongoose

I'm storing some data I'm getting from API calls in a collection ('Asin'). - work just fine. I build two pages -register & log in, installed all relevant bc

Heroku Error. Cannot find module 'Mongoose'

For some odd reason (i have been deployed on Heroku for around 1.5 years) my instance decided to throw a weird error regarding not finding 'mongoose' after atte

Typegoose not working with vuetify in electron

Im trying to build a very simple model with typegoose inside Vue + electron. This is my simplified code: import { getModelForClass, prop, modelOptions } fro

Mongoose ValidationError makes Express Server crashed

I have struggled with this problem for many days. Whenever I make an invalid POST request, it throws me an Error. Sounds good but when I cancel that request, th

Mongoose ValidationError makes Express Server crashed

I have struggled with this problem for many days. Whenever I make an invalid POST request, it throws me an Error. Sounds good but when I cancel that request, th

how to solve Prototype Pollution issue in VS code

I installed a package that is related to my learning courses. the codes are released on 2018 and I updated all the versions on package-lock.json and package.jso

Exceeded timeout of 5000 ms for a test with Jest and MongoDB

I'm trying to implement database population by using a migration function. The code works perfectly, it saves all the data into the database, but the test for t

How to store and retrieve checkbox state on refresh of page? Mongoose/EJS/Nodejs/Express

I have a checkbox, essentially like a to do list. When i check the box, I want to retain the state even after i refresh the page by using mongoose. I do know of

Boost search score from data in another collection

I use Atlas Search to return a list of documents (using Mongoose): const searchResults = await Resource.aggregate() .search({ text: { query

Remove certain fields from the mongoose HydratedDocument

When we lean the documents, the id property is still included which is undefined and can cause unexpected errors. To simplify this for my team, I want to remove

Can't populate Mongoose schema on express route

So I want to populate two things and return them in the response, I want to return an array of images and the author. However the response returns nothing, if I

How to remove schema validation in mongoose (mongodb)?

I have MongoDB server version: 5.0.6 installed and used "mongoose": "^6.0.14" to create a model validation. Example of model: const User = new Schema({ name:

NextJS: load global plugin in Mongoose before model creation

I have a folder structure looking something like this root/ pages/ models/ User.js utils/ plugin.js dbConnect.js I want to be able to load th

In mongoose I have executed the example program given in the website but I'm getting the same error that is: TypeError: fluffy.speak is not a function

const mongoose = require('mongoose'); main().catch(err => console.log(err)); async function main() { await mongoose.connect('mongodb://localhost:27017/t

Node js SyntaxError: Unexpected token 'export'

I'm having the following error in the console when I try to run my api written in node js. Can you tell me which is the problem.

Getting error: The expression is not callable Mongoose NextJS

I trying to save data to a mongoose model on NextJS page. I get a typescript error on this line: await User.create(data) This expression is not callable. Each

I can't call PATCH method using Pug, Mongoose and Express.js

I am new to code and I apologize in advance for all my noob mistakes. I'm trying to set a new color to an existing object stored in MongoDB using the PATCH meth

How to query mongoDB with mongoose without having a model

so i want to query my mongo DB without using a model, let me preface this by saying, i am looking for options other than using the mongodb driver. so in one app

MongooseError: Operation 'featureds.find()` buffering timed out after 10000ms

I have a collection on MongoDB from which I'm trying to query all the elements using find(): const mongoose = require('mongoose'); const Featured = mongoose.mod