skip to Main Content

Mongodb – Mongoose Filter Not Working With Find Method

I am writing code with node.js and mongoose module. My used module is "find" method but mongo is getting all data to me so filter is not working. What is problem ? Example Codes: const mongoose = require('mongoose') mongoose.connect('mongodb://localhost:27017/nodeV1').then(res=>console.log("Connection Success")).catch(e=>console.log("Error"))…

VIEW QUESTION

Mongodb – Given an id of a document with recursive field `children`, find all documents that reference the document or any of its children

I have a collection of product folders productfolders and a collection of products products. const ProductFolderSchema = new Schema( { folderName: { type: String, required: true }, parent: { type: Schema.Types.ObjectId, ref: 'ProductFolder' }, children: [{ type: Schema.Types.ObjectId, ref: 'ProductFolder'…

VIEW QUESTION
Back To Top
Search