mirror of
https://github.com/taigrr/yq
synced 2025-01-18 04:53:17 -08:00
Task: Add docs on keys with dots
Adds documentation on how to use a key lookup indicator for dealing with keys that have dots when specifying a path as part of create, read, and write commands. Resolves: #22
This commit is contained in:
@@ -280,6 +280,13 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#keys-with-dots" title="Keys with dots" class="md-nav__link">
|
||||
Keys with dots
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
@@ -392,6 +399,13 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#keys-with-dots" title="Keys with dots" class="md-nav__link">
|
||||
Keys with dots
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
@@ -520,6 +534,20 @@ b.e[0].name: Howdy Partner
|
||||
<pre><code class="yaml">my:
|
||||
path: -3
|
||||
</code></pre>
|
||||
|
||||
<h3 id="keys-with-dots">Keys with dots<a class="headerlink" href="#keys-with-dots" title="Permanent link">¶</a></h3>
|
||||
<p>When specifying a key that has a dot use key lookup indicator.</p>
|
||||
<pre><code class="yaml">b:
|
||||
foo.bar: 7
|
||||
</code></pre>
|
||||
|
||||
<pre><code class="bash">yaml r sample.yaml b[foo.bar]
|
||||
</code></pre>
|
||||
|
||||
<pre><code class="bash">yaml w sample.yaml b[foo.bar] 9
|
||||
</code></pre>
|
||||
|
||||
<p>Any valid yaml key can be specified as part of a key lookup.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user