Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

CLI and supported JsonPaths #118

Open
ainthek opened this issue Jan 9, 2017 · 1 comment
Open

CLI and supported JsonPaths #118

ainthek opened this issue Jan 9, 2017 · 1 comment

Comments

@ainthek
Copy link

ainthek commented Jan 9, 2017

What syntax can be used to access arrays ?
I believe that this is correct JSONPath, but it does not work from CLI.
Please provide more info in readme.md if possible

cat sample.json | JSONStream 'store.book[2]'

{ "store": {
"book": [
{ "category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{ "category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99
},
{ "category": "fiction",
"author": "Herman Melville",
"title": "Moby Dick",
"isbn": "0-553-21311-3",
"price": 8.99
},
{ "category": "fiction",
"author": "J. R. R. Tolkien",
"title": "The Lord of the Rings",
"isbn": "0-395-19395-8",
"price": 22.99
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
}
}

@Poetro
Copy link

Poetro commented Jan 9, 2017

$ cat sample.json | JSONStream 'store.book.2'
[{
  "category": "fiction",
  "author": "Herman Melville",
  "title": "Moby Dick",
  "isbn": "0-553-21311-3",
  "price": 8.99
}]

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

No branches or pull requests

2 participants