node.js - Why Mongoose saves references of child ids in parent model? -
I am trying to log into MongoDB and Node.js and found that the most recommended module for using is Mongoose I liked the idea of making a schema like my SQL and it is very easy to use.
One thing I did not understand is about references. Now the question is - why do I need to reference Event ID from within the session? Why not just ask events.Model.Fund ({session: session._id})? I am afraid that this will create large session documents because there can be hundreds of events in one session. What am I missing here?
Depends well, generally the common path is to create those types of references To populate your query with the data referenced in the form, as I have removed from the population documentation:
No one is involved in mangodibi, but sometimes we are in other collections The context of the documents also wants to be the place where the population comes.
If you are interested in the population then you take a peak
You can not harm it manually, depending on your needs and Your Questions
Comments
Post a Comment