There are currently 2 models Product and Books; where Book inherits from Product as shown below: Additionally, there is a Cart schema, which has a ...
There are currently 2 models Product and Books; where Book inherits from Product as shown below: Additionally, there is a Cart schema, which has a ...
I created a database on MongoDB setting the _id (string) of the documents myself. Now when I try to find and populate I get this error: The part of ...
My code simply is I want to let the user bookmark different types of products. This is on the user schema How can I set the refPath to look on the ...
I have a User model with a schema that I would like to validate an array of multiple friends by their id's. The portion of the schema that is supposed ...
I am working on e-commerce like app. I have orderItem Schema Where product schema has a field "owner" which is also a reference. I am expecting to ...
First of all, I found a lot of answers about that problem in StackOverflow However, none of them worked on my problem. I have an userSchema like that ...
I have a summary schema with a structure like this { sender: { type: mongoose.Schema.Types.ObjectId, ref: "User", required: t ...
I'm trying to use refPath to reference which collection to pull the population data from inside my schema, and even though it looks identical to the e ...
I'm pretty new to MongoDB and I encounter a weird behavior when using populate. Here are my Schemas: This is a typical exercise document in my data ...
This is Data from the Database . But I cant populate the array of Id's in the appointment Array .enter image description here How can I populate the ...
I have two models. On the first model I have a virtual field which should be populated by the other (one to many relationship). And it's not working. ...
So bassically I have three roles for users admin seller buyer This is my User Scheme This is my User Roles Schemas Seller Schema Buye ...
I'm trying to do a populate in mongo I've tried everything but I always get this error. I'm really frustrated already mi function model trade m ...
Suppose I have two schemas on MongoDB: Every time a user logs in, I would like to show the things that they have posted, as well as the fans that a ...
I would like to query specific values from a two level Mongoose populate. ...
I am a beginner, Can anyone tell me why we have to need to import the whole schema into a new schema Object as an array? what's that Purpose? pages: ...
I would like to ask on how I can save a Sub Category by getting the ID of the Category. Category Model Sub Category model My Controller My q ...
I have the following schema as per the docs: And when I'm populating the virtual nothing happens: However if I add "ref" to the userId in the sc ...
I am trying to populate fromStaffId and toStaffId with lookup but in my case when my id matches with fromStaffId then i have to populate toStaffId ...
In my Transaction Array field I have two different Object Id. One is Deposit and another one is Withdraw. And I need to populate both Object Id. For ...