Aggregate vs Populate methods when to use one in nodejs Mongose
I am creating asset managment tool for warehouse and I have Warehouse , Asset, Category models. I want to get the overall stats of each warehouse like , total assets and how many of them is active or in-store, so that I used aggregate but It seams to me more time consuming .
I can’t import my User model on my new service files, it says undefined
I have an express.js application. It contains several models and the User model is one of them.
express-async-handler and mongoose session
In few videos I followed, they recommend to use express-async-handler but I am still not clear on it. But more importantly, how can one use it with sessions?
Join mongodb collection by object of object
Using mongoose in express js I want to join above collection by payment.payment_id from Product model with _id (object ID) from payments.
Join collection through UUID using mongoose
My project developed in express js. I am facing a problem since long time. I want to join 2 collections by user_id (from products ) and _id (from users). Please note that _id is UUID. It works for others field . But when I try to make relation with _id it returns empty array.
remove _id inside schema mongoose
If there is an external schema and not an internal schema, can I delete the ID of this schema? Any plan without an ID, is that possible?
I need to remove from the schema and not save in database
#mongoose
#express
mongoose virtual population not working correctly
I’ve check all related questions on stackoverflow and also visit the mongoose docs, everything seems to be good. But the problem is when i’m trying to get tour by id.
validation should run after all other pre-update hooks
I am trying to update a user document