I’m refactoring my code and trying to achieve this the sorting of a collection by parent page.
Before, I had 4 collections created : project_featured, side_featured, project and side. All this was aggregated in a collection, and displayed in this order.
Now that I return in my old code, I try to use the
sortBy function as it seems more logical and less verbose. So I just aggregated projects and side together, and did a
sortBy('featured', 'desc', 'sort', 'asc') on it.
It works, except that projects from regular projects and side projects are now mixed (but sorting by featured or not is ok).
Is there a way to add a parameter in sorting to keep the parent page and achieve what I had before or have I to keep 4 collections and group it afterhand?
Also: what is the difference between