jmespath / jmespath/jmespath.js

Default value needed if key not exist inside some object in array of objects

Open
#64 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
847
Forks
101
PR merge metrics
No merged PRs in 30d

Description

Hi, I am looking for a solution where my data is
`[
{
"name": "rahul",
"email": "rahul@domain.com"
},
{
"name": "amit",
"email": "amit@domain.com"
},
{
"email": "divyesh@domain.com"
},
{
"name": "brijesh",
"email": "brijesh@domain.com"
}
]`
Note: name key is missing in third object

query: `[].name`

result:
`[
"rahul",
"amit",
"brijesh"
]`

expected result:
`[
"rahul",
"amit",
"",
"brijesh"
]`

please help

Thanks

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.