I am trying to update documents values, if they already exist in a collection, if they have the same value for a specific object key. For example, I have the fo
Okay, the title is a bit too verbose and complicated but I have no idea how to put it any better. So here's what I have ModelA ModelB that has reference to Mode
I am using NextJS as my framework along with Mongoose. I have seen a few tutorials to implement caching for Mongoose but everytime I make some
here is my scheme, I wasnt to create one record so when i am passing field in graphql it is showing error const { BookTC } = require("../model/book"); const { B
If I have a survey application for child tracking what is the best way to save survey questions in MongoDB? Knowing that survey is divided into stages (about 12
I have the following error TypeError: C:\Users\USER PC\Documents\Prime_News_Hub\views\Top_Stories.ejs:27 25| 26| <% if(file){ %>
Just started with a javascript couple of days back. I am trying to use MongoDB with mongoose to write the data but it is not writing even though the connection
I am a beginner JavaScript developer. I am getting this error when I try to get all soldiers by route: "localhost:3005/api/v1/soldiers" in POSTMAN. In order to
I have this mongoose.connect statement in my server.js file: const db = mongoose.connect(config.db, { 'useNewUrlParser': true, 'useUnifiedTopology': tru
so I have a schema where I want to add ObjectID to an array of id's in mongoose, I tried adding it unique, but did not work. Most likely because I need to itera
I have a feedbackQuestion schema which takes (title: string, subtitle: string, types: enum, values: enum) import { Prop, Schema, SchemaFactory } from '@nestjs/m
I am trying to show results where the sum of records is greater or equal to 4 and the status matches a string. If I leave off the status field it works fine but
I have a user schema that has an email field, the email field must be unique. However, the problem is that when someone wants to delete a user, my code does not
I tried to do basic things. I have an array that contains multiple objects. I want to add new key-value pair in every array object. I tried this by following co
I was working on a MERN app and was trying to use jason web-token (JWT) and bcrypt for authentication. It uses two routes for signup and authentication. However
How can I add an image to my mongodb when using the mongoose.schema in JS? const chequeSchema = new schema({ chequeImageUri: { type: Image, req
i'm working on a web app in which a user can create an address when logged in, how can i get the current logged in user address which was created by the user th
How to join three (multipe) collections with $lookup in mongodb? Hi I am looking to join data from three collection users collection: [ { _id:0, name:"abc", pho
I use mongoose findOneAndUpdate method, but could't achieve the result. I always get the same object back. No errors. Here's my code. User object: { "_id" :
I've trying to create an endpoint in my API which return the youngest and oldest person from my database using mongodb e mongoose. My database looks like that: