Skip to content

Feature request: Extend wilayaProjection to project nested fields #27

@Fcmam5

Description

@Fcmam5

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:

projectWilaya(someWilayaObject, ['name', 'dairats.name']);

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 project daira object

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions