黄舟2017-04-17 16:34:09
If I understand your idea correctly, FYI:
1. The ref of Mongoose schema is mainly used to facilitate the association between multiple collections in queries: populate;
2. When inserting data, you need to handle the insertion logic yourself, insert different collections separately, and keep the ObjectId of the ref in different collections consistent
For reference.
Love MongoDB! Have fun!
MongoDB Online Lecture Series 19- MongoDB 10 steps to build a single view
It’s April 19th, please click:>---<