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

update README #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ document and transform it into another JSON document
through a JMESPath expression.

Using go-jmespath is really easy. There's a single function
you use, `jmespath.search`:
you use, `jmespath.Search`:


```go
Expand All @@ -23,9 +23,9 @@ you use, `jmespath.search`:
result = 2
```

In the example we gave the ``search`` function input data of
In the example we gave the ``Search`` function input data of
`{"foo": {"bar": {"baz": [0, 1, 2, 3, 4]}}}` as well as the JMESPath
expression `foo.bar.baz[2]`, and the `search` function evaluated
expression `foo.bar.baz[2]`, and the `Search` function evaluated
the expression against the input data to produce the result ``2``.

The JMESPath language can do a lot more than select an element
Expand All @@ -35,15 +35,15 @@ from a list. Here are a few more examples:
> var jsondata = []byte(`{"foo": {"bar": {"baz": [0, 1, 2, 3, 4]}}}`) // your data
> var data interface{}
> err := json.Unmarshal(jsondata, &data)
> result, err := jmespath.search("foo.bar", data)
> result, err := jmespath.Search("foo.bar", data)
result = { "baz": [ 0, 1, 2, 3, 4 ] }


> var jsondata = []byte(`{"foo": [{"first": "a", "last": "b"},
{"first": "c", "last": "d"}]}`) // your data
> var data interface{}
> err := json.Unmarshal(jsondata, &data)
> result, err := jmespath.search({"foo[*].first", data)
> result, err := jmespath.Search({"foo[*].first", data)
result [ 'a', 'c' ]


Expand All @@ -52,7 +52,7 @@ result [ 'a', 'c' ]
{"age": 40}]}`) // your data
> var data interface{}
> err := json.Unmarshal(jsondata, &data)
> result, err := jmespath.search("foo[?age > `30`]")
> result, err := jmespath.Search("foo[?age > `30`]", data)
result = [ { age: 35 }, { age: 40 } ]
```

Expand Down