W
W
webe2019-01-04 01:08:38
MongoDB
webe, 2019-01-04 01:08:38

How to get the goods?

I'm learning mongo , there are 2 collections : categories and products
In the first category hierarchy.
In the second list of goods.
The question is how to bind a product to a category and how to display all products in a specific category.
As I understand it, there are no Joins here and do you need some other way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
UNy, 2019-01-04
@UNy

https://mongoosejs.com/docs/populate.html
Read about populate and ref. And don't work with bare mongo, use mongoose.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question