Skip to content
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

How to include non-array property as root? #30

Open
rmtuckerphx opened this issue Apr 8, 2018 · 1 comment
Open

How to include non-array property as root? #30

rmtuckerphx opened this issue Apr 8, 2018 · 1 comment

Comments

@rmtuckerphx
Copy link

If I have data like this:

var data = {
    "status": "OK",
    "results": [
        {
            "id": "1",
            "type": "dentist",
            "name": "Sally Smith"
        },
        {
            "id": "2",
            "type": "doctor",
            "name": "Mary Mitchell"
        }
    ]
};

Is there a map that will result in expected output of this?

{
    "status": "OK",
    "results": [
        {
            "id": "1",
            "fullname": "Sally Smith"
        },
        {
            "id": "2",
            "fullname": "Mary Mitchell"
        }
    ]
};
@bozzltron
Copy link
Owner

bozzltron commented Apr 10, 2018

var map = { list: 'results', item: { remove: ['name'] } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants