I am trying to get an array in my req.query and want to use the elements in that array for filtering of data but unable to do so. As you can see in the below co
I have a Customer DB and I want to aggregate through my data and display all the duplicates on frontend, I'm checking my get request with Insomnia and I get al
I'm migrated from MySQL to MongoDB and looking to optimize the storage of my time-series data. Each item in my database has an array of values for multiple loca
I want to make a mongoose schema that will append timeseries data. I got the idea for that model after reading this (https://www.mongodb.com/blog/post/schema-de
For my whole projects I have relationed my multiple collection as this. User model Name:string, email:string, password:string, vehicles:[{ "vehicleId", "vehi
I want to edit an array with mongoose, if the object id already exist in the array, then it will create a new one, and if it exist, it will update. My code: con
recipe = new Recipe(_.pick(req.body, ['name', 'tag', 'recipe'])); await recipe.save(); }); error: recipe = new Recipe(_.pick(req.body, ['name', 'tag
I had a Post Model with a ref as below const mongoose = require("mongoose"); const PostSchema = new mongoose.Schema( { _id: mongoose.Schema.Types.O
I have this mongoose schema const PictureSchema = mongoose.Schema({ user: { type: mongoose.Schema.Types.ObjectId, ref: 'User', requi
I have a model that uses a Map for eg: (I also have other properties such as Name) export class User { _id!: string; accounts!: Map<String,Number>
I'm creating an application in the MERN stack and I stumbled upon a problem. I will start by explaining how that app is going to work. So, in that application u
Here is my very basic product schema: const productSchema = new Schema({ productName: { type: String, required: true, }, productDescription: {
So I want to display MongoDB data in HTML so I used the EJS template but this is the error it is showing . I can't seem to figure out where the problem is, IS i
I'm building an API for my web app and I was able to successfully send requests to the routes in Post.js when they only had url params. But when I try to create
Im learning mongoose and i have a question how to save several documents: // Product.js const categorySchema = mongoose.Schema( { name: String }, { collecti
I'm quite new to using Mongoose and therefore not too familiar with operations that go beyond finding data in a single collection. Was googling approaches to ac
I am creating a e-commerce app and now I want to update and delete a review of a product using nodejs and database is mongoDB (using mongoose). This is my User
I am trying to inject dependencies in mongoose module for root async. I want to kind of simulate a cascade delete using mongoose hooks. I have this module, whic
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