Skip to content

Commit b4759bb

Browse files
committed
Deployed 32b69c7 with MkDocs version: 1.4.2
1 parent e0d7332 commit b4759bb

3 files changed

Lines changed: 95 additions & 3 deletions

File tree

‎functions/index.html‎

Lines changed: 94 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,39 @@
402402
</label>
403403
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
404404

405+
<li class="md-nav__item">
406+
<a href="#count" class="md-nav__link">
407+
count()
408+
</a>
409+
410+
</li>
411+
405412
<li class="md-nav__item">
406413
<a href="#length" class="md-nav__link">
407414
length()
408415
</a>
409416

417+
</li>
418+
419+
<li class="md-nav__item">
420+
<a href="#match" class="md-nav__link">
421+
match()
422+
</a>
423+
424+
</li>
425+
426+
<li class="md-nav__item">
427+
<a href="#search" class="md-nav__link">
428+
search()
429+
</a>
430+
431+
</li>
432+
433+
<li class="md-nav__item">
434+
<a href="#value" class="md-nav__link">
435+
value()
436+
</a>
437+
410438
</li>
411439

412440
</ul>
@@ -543,11 +571,39 @@
543571
</label>
544572
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
545573

574+
<li class="md-nav__item">
575+
<a href="#count" class="md-nav__link">
576+
count()
577+
</a>
578+
579+
</li>
580+
546581
<li class="md-nav__item">
547582
<a href="#length" class="md-nav__link">
548583
length()
549584
</a>
550585

586+
</li>
587+
588+
<li class="md-nav__item">
589+
<a href="#match" class="md-nav__link">
590+
match()
591+
</a>
592+
593+
</li>
594+
595+
<li class="md-nav__item">
596+
<a href="#search" class="md-nav__link">
597+
search()
598+
</a>
599+
600+
</li>
601+
602+
<li class="md-nav__item">
603+
<a href="#value" class="md-nav__link">
604+
value()
605+
</a>
606+
551607
</li>
552608

553609
</ul>
@@ -566,9 +622,45 @@
566622

567623

568624
<h1 id="filter-functions">Filter Functions</h1>
569-
<p>TODO:</p>
625+
<p>A filter function is a named function that can be called as part of a <a href="../syntax/#filters-expression">filter selector</a> expression. Here we describe the standard, built-in filters. You can <a href="../advanced/">define your own function extensions</a> too.</p>
626+
<h2 id="count"><code>count()</code></h2>
627+
<div class="language-text highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>count(obj: object) -&gt; Optional[int]
628+
</span></code></pre></div>
629+
<p>Return the number of items in <em>obj</em>. If the object does not respond to Python's <code>len()</code> function, <code>None</code> is returned.</p>
630+
<div class="language-text highlight"><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>$.categories[?count(@.products.*) &gt;= 2]
631+
</span></code></pre></div>
632+
<div class="admonition warning">
633+
<p class="admonition-title">Warning</p>
634+
<p>As of Python JSONPath version 0.5.0, <code>count</code> is an alias for <code>length</code>. This might change in the future.</p>
635+
</div>
570636
<h2 id="length"><code>length()</code></h2>
571-
<p>TODO:</p>
637+
<div class="language-text highlight"><pre><span></span><code><span id="__span-2-1"><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a>length(obj: object) -&gt; Optional[int]
638+
</span></code></pre></div>
639+
<p>Return the number of items in the input object. If the object does not respond to Python's <code>len()</code> function, <code>None</code> is returned.</p>
640+
<div class="language-text highlight"><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>$.categories[?length(@) &gt; 1]
641+
</span></code></pre></div>
642+
<h2 id="match"><code>match()</code></h2>
643+
<div class="language-text highlight"><pre><span></span><code><span id="__span-4-1"><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>match(obj: object, pattern: str) -&gt; bool
644+
</span></code></pre></div>
645+
<p>Return <code>True</code> if <em>obj</em> is a string and is a full match to the regex <em>pattern</em>.</p>
646+
<div class="language-text highlight"><pre><span></span><code><span id="__span-5-1"><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>$..products[?match(@.title, &quot;.+ainers.+&quot;)]
647+
</span></code></pre></div>
648+
<p>If <em>pattern</em> is a string literal, it will be compiled at compile time, and raise a <code>JSONPathTypeError</code> at compile time if it's invalid.</p>
649+
<p>If <em>pattern</em> is a query and the result is not a valid regex, <code>False</code> is returned.</p>
650+
<h2 id="search"><code>search()</code></h2>
651+
<div class="language-text highlight"><pre><span></span><code><span id="__span-6-1"><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a>search(obj: object, pattern: str) -&gt; bool
652+
</span></code></pre></div>
653+
<p>Return <code>True</code> if <em>obj</em> is a string and it contains the regexp <em>pattern</em>.</p>
654+
<div class="language-text highlight"><pre><span></span><code><span id="__span-7-1"><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a>$..products[?search(@.title, &quot;ainers&quot;)]
655+
</span></code></pre></div>
656+
<p>If <em>pattern</em> is a string literal, it will be compiled at compile time, and raise a <code>JSONPathTypeError</code> at compile time if it's invalid.</p>
657+
<p>If <em>pattern</em> is a query and the result is not a valid regex, <code>False</code> is returned.</p>
658+
<h2 id="value"><code>value()</code></h2>
659+
<div class="language-text highlight"><pre><span></span><code><span id="__span-8-1"><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a>value(nodes: object) -&gt; object | undefined
660+
</span></code></pre></div>
661+
<p>Return the first value from <em>nodes</em> resulting from a JSONPath query, if there is only one node, or <code>undefined</code> otherwise.</p>
662+
<div class="language-text highlight"><pre><span></span><code><span id="__span-9-1"><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a>$..products[?value(@.price) == 9]
663+
</span></code></pre></div>
572664

573665

574666

0 commit comments

Comments
 (0)