Dmitri Pisarev
07/05/2022, 6:52 AMPost.categories
relation. In inverse relation Category.posts
would explode the Category
entity, there would be hundreds of thousands of entries in it. Besides, it may eventually lead to inconsistent date if Post.categories
wouldn’t match Category.posts
for some reason.
So is there a way to only store the relation information on a Post
side and query things based only on it?
An alternative would be to get rid of m-n relations entirely and query for such relations manually. Which would be a shame of course.nikolasburk
Dmitri Pisarev
07/05/2022, 8:39 AMThe reason we choose to embed all the references to categories in the books is due to there being lot more books in the drama category than categories in a book. If one embeds the books in the category document it’s easy to foresee that one could break the 16MB max document size for certain broad categories.
nikolasburk
Dmitri Pisarev
07/05/2022, 11:12 AMjanpio
janpio
Dmitri Pisarev
07/05/2022, 1:37 PMjanpio
janpio
Dmitri Pisarev
07/05/2022, 1:42 PMjanpio
janpio
Dmitri Pisarev
07/05/2022, 4:14 PMDmitri Pisarev
07/05/2022, 4:15 PMjanpio
janpio
Dmitri Pisarev
07/05/2022, 4:39 PMjanpio