-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Extend wilayaProjection to project nested fields #27
Comments
@InternetRamen can you take it? |
@Fcmam5 I think I can take it. |
@Fcmam5 In your example, |
I mean that if we want only the wilaya [
{
"name": "Adrar",
"dairats": [
{
"name": "ADRAR"
},
{
"name": "CHAROUINE"
},
{
"name": "REGGANE"
},
...
]
}
] |
@Fcmam5 |
Sorry, it was a typo 😅 |
Related to wilayaProjection:
The goal if this helper function is to return only the Wilaya objects properties that a user wants (Otherwise they will receive an element like this big & ugly 😄 ).
For now we can use this feature to only return only wilaya fields we want (example, and it will be great if we can project dairats (a Wilaya property containing an array of objects).
So when we call:
You should only return the wilaya name and only names of its
dairats
.We'd prefer a simple and minimalist solution, but if needed you can use any library you like. If you need some inspiration you can check projects like jq. Or just keep it simple, split by
.
and then add a magical recursive function to projectdaira
objectThe text was updated successfully, but these errors were encountered: