Skip to content

Commit 3f0d777

Browse files
committed
docs: improve the documentation about using function get() for properties
1 parent f252a59 commit 3f0d777

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,19 @@ A property can be unquoted when it only contains characters `a-z`, `A-Z`, `_` an
293293
."first name"
294294
```
295295

296-
To get the current value itself, use the function `get()` without arguments.
296+
To get the current value itself, use the function `get` without arguments:
297+
298+
```text
299+
get()
300+
```
301+
302+
And, alternatively to the dot notation, the function `get` can be used for properties and nested properties too:
303+
304+
```text
305+
get("age")
306+
get("address", "city")
307+
```
308+
297309

298310
### Values
299311

docs/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,8 @@ <h1>JSON Query</h1>
424424
<pre><code>.age</code></pre>
425425
<pre><code>.address.city</code></pre>
426426
<pre><code>."first name"</code></pre>
427+
<pre><code>get()</code></pre>
428+
<pre><code>get("address", "city")</code></pre>
427429
<p>
428430
Documentation:
429431
<a href="https://github.com/jsonquerylang/jsonquery#properties" target="_blank">Properties</a>

0 commit comments

Comments
 (0)