-
Notifications
You must be signed in to change notification settings - Fork 22
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
Indexing an array #3
Comments
Hello, this is not in the original specification but would be usefull. We will check what keyword we can add for this. |
2 random thoughts: 'ndx' or 'pos' |
A colleague suggested: 'offset' |
Thanks for the feedback. |
How does one go about proposing changes to the official specification? |
I think you must head over to the official site and write a pull request to the spec. |
I want this:
[
{
"index": 0,
"name": "a",
"state": "up"
},
{
"index": 1,
"name": "b",
"state": "down"
},
{
"index": 2,
"name": "c",
"state": "up"
}
]
From this:
{
"people": [
{
"name": "a",
"state": {"name": "up"}
},
{
"name": "b",
"state": {"name": "down"}
},
{
"name": "c",
"state": {"name": "up"}
}
]
}
But there is no '@.index' to allow this to work:
people[].{"index":@.index,"name":name, "state":state.name}
I realize this is not strictly a query function but AFAIK the items in a JSON list are ordered so it would not be arbitrary to associate a fixed index to each item.
Is there already a way to get this information?
The text was updated successfully, but these errors were encountered: