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:
I'm trying to fetch an array of objects from MongoDB, using mongoose and SSP. One hitch is that all ObjectIds must be converted into strings. Currently I'm doin
I want to apply validation on controller level similar to what we have in a Form Request in Laravel but I want that in Node JS. I want to know the required fiel
I have created a new Mongo collection to a new project, but when I try to create a new user, I get the following error: MongoError: E11000 duplicate key error c
One aspect of my website is that people can join groups according to a specific code provided to them, for example- when we play 'Kahoot' or 'Psych', we have to
I need to have a playerID that is separate from _id and increments with each new entry into my users collection. I have tried to follow this tutorial with no lu
there is a wfs collection as follows: { _id:'1', transitions: [ { _id:'11', checkLists: [ { _id:'111',
Im trying to make a greater than query but it always returns an empty array. const productSchema = require("./productsSchema"); const getProductsGreaterThan
So I have two schemas user and driver they both have latitude and longitude attributes. At some point I want to query the database for nearby drivers, I will be
I am trying to build a CRUD API that query a mongodb. I want to add another attribute (temperature) to the query result before sending it back to the client. Pa
I'm building a simple MERN blogging app with a local MongoDB. Everything was working fine until yesterday. I literally changed nothing at all and now I can't co
I have an app with MongoDB (Mongoose) in NodeJs. In a collection I have this type of documents, defined by weeks: { "_id": {"$oid":"617f3f51f883fab2de3e7260"},
I'm trying to fetch an array from my user database from my react app. The response I'm getting is an HTML file, but I'm not sure why it's not working as I have
I've been trying for over 2 hours now trying to figure out what's wrong with this database. I've tried everything. From reinstalling the server, restarting the
I am trying to add a number indicator to my cart icon that will display the number of items added after the product has been saved to my database. <div class
I have working on my final year college project On MERN stack. my problem is mentioned bellow please help me. const Organization = mongoose.Schema({ name: {
I'm trying to seed my entire database for all the necessary resources that need to be present to test my API successfully. My tests are in several files. How ca