Replies: 1 comment
-
Hi Giduya, You data should looks like :
and your aggregate :
Apply this in you PHP framework... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This are my documents:
{
"_id": "621113c8166924399446756e",
"metadata":
{
"country": "mexico",
"lenguage": "spanish",
"continent": "america",
"demographics":
[
"population": 3,000,000,
"minority" : "white people"
],
[
"population": 5,000,000,
"minority" : "indigenous people"
],
[
"population": 500,000,
"minority" : "black people"
],
}
how can i order by population:
$pagination = Countries::orderBy('continent'.'asc')->orderby('country','asc')->orderby('demographics.population','asc');
i get this error:
Executor error during find command :: caused by :: cannot sort with keys that are parallel arrays
Beta Was this translation helpful? Give feedback.
All reactions