Data.findOne({}).then((respp)=>console.log(respp, "find one")) Like I have this method this is returning First object and if I apply a condition then i can
How to sort data based on entry of parent collection in mongodb using mongoose package. My schema is organised as given below Profile Schema const mongoose
I'm currently working on a movie database with graphql and mongodb. When a new review is added I want to push the review id immediately to the reviews array of
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
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
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
Im trying to build a very simple model with typegoose inside Vue + electron. This is my simplified code: import { getModelForClass, prop, modelOptions } fro
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
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
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
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
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
I use Atlas Search to return a list of documents (using Mongoose): const searchResults = await Resource.aggregate() .search({ text: { query
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
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
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:
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
const mongoose = require('mongoose'); main().catch(err => console.log(err)); async function main() { await mongoose.connect('mongodb://localhost:27017/t
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.
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