UNPKG

prismic.io

Version:

JavaScript development kit for prismic.io

4,570 lines (1,238 loc) 58.2 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Namespace: Predicates</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Namespace: Predicates</h1> <section> <header> <h2>Predicates</h2> </header> <article> <div class="container-overview"> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3176">line 3176</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id=".any"><span class="type-signature">(static) </span>any<span class="signature">(fragment, values)</span><span class="type-signature"> &rarr; {Array}</span></h4> <div class="description"> Build an "any" predicate: equality of a fragment to a value. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>values</code></td> <td class="type"> <span class="param-type">Array</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3256">line 3256</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> an array corresponding to the predicate </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.any("document.type", ["article", "blog-post"])</code></pre> <h4 class="name" id=".at"><span class="type-signature">(static) </span>at<span class="signature">(fragment, value)</span><span class="type-signature"> &rarr; {Array}</span></h4> <div class="description"> Build an "at" predicate: equality of a fragment to a value. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3210">line 3210</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> an array corresponding to the predicate </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.at("document.type", "article")</code></pre> <h4 class="name" id=".dateAfter"><span class="type-signature">(static) </span>dateAfter<span class="signature">(fragment, after)</span><span class="type-signature"> &rarr; {Array}</span></h4> <div class="description"> Build a "date.after" predicate: documents where the fragment field is after the given date. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">the name of the field - must be a date or timestamp field.</td> </tr> <tr> <td class="name"><code>after</code></td> <td class="type"> <span class="param-type">Date</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3353">line 3353</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> an array corresponding to the predicate </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.dateAfter("my.product.releaseDate", new Date(2014, 1, 1))</code></pre> <h4 class="name" id=".dateBefore"><span class="type-signature">(static) </span>dateBefore<span class="signature">(fragment, before)</span><span class="type-signature"> &rarr; {Array}</span></h4> <div class="description"> Build a "date.before" predicate: documents where the fragment field is before the given date. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">the name of the field - must be a date or timestamp field.</td> </tr> <tr> <td class="name"><code>before</code></td> <td class="type"> <span class="param-type">Date</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3341">line 3341</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> an array corresponding to the predicate </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.dateBefore("my.product.releaseDate", new Date(2014, 6, 1))</code></pre> <h4 class="name" id=".dateBetween"><span class="type-signature">(static) </span>dateBetween<span class="signature">(fragment, before, after)</span><span class="type-signature"> &rarr; {Array}</span></h4> <div class="description"> Build a "date.between" predicate: combination of dateBefore and dateAfter </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">the name of the field - must be a date or timestamp field.</td> </tr> <tr> <td class="name"><code>before</code></td> <td class="type"> <span class="param-type">Date</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>after</code></td> <td class="type"> <span class="param-type">Date</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3366">line 3366</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> an array corresponding to the predicate </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.dateBetween("my.product.releaseDate", new Date(2014, 1, 1), new Date(2014, 6, 1))</code></pre> <h4 class="name" id=".dayOfMonth"><span class="type-signature">(static) </span>dayOfMonth<span class="signature">(fragment, day)</span><span class="type-signature"> &rarr; {Array}</span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>day</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">between 1 and 31</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3377">line 3377</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.dayOfMonth("my.product.releaseDate", 14)</code></pre> <h4 class="name" id=".dayOfMonthAfter"><span class="type-signature">(static) </span>dayOfMonthAfter<span class="signature">(fragment, day)</span><span class="type-signature"> &rarr; {Array}</span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>day</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">between 1 and 31</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3388">line 3388</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.dayOfMonthAfter("my.product.releaseDate", 14)</code></pre> <h4 class="name" id=".dayOfMonthBefore"><span class="type-signature">(static) </span>dayOfMonthBefore<span class="signature">(fragment, day)</span><span class="type-signature"> &rarr; {Array}</span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>day</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">between 1 and 31</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3399">line 3399</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.dayOfMonthBefore("my.product.releaseDate", 14)</code></pre> <h4 class="name" id=".dayOfWeek"><span class="type-signature">(static) </span>dayOfWeek<span class="signature">(fragment, day)</span><span class="type-signature"> &rarr; {Array}</span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>day</code></td> <td class="type"> <span class="param-type">Number</span> | <span class="param-type">String</span> </td> <td class="description last">Number between 1 and 7 or string between "Monday" and "Sunday"</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3410">line 3410</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.dayOfWeek("my.product.releaseDate", 14)</code></pre> <h4 class="name" id=".dayOfWeekAfter"><span class="type-signature">(static) </span>dayOfWeekAfter<span class="signature">(fragment, day)</span><span class="type-signature"> &rarr; {Array}</span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>day</code></td> <td class="type"> <span class="param-type">Number</span> | <span class="param-type">String</span> </td> <td class="description last">Number between 1 and 7 or string between "Monday" and "Sunday"</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3421">line 3421</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.dayOfWeekAfter("my.product.releaseDate", "Wednesday")</code></pre> <h4 class="name" id=".dayOfWeekBefore"><span class="type-signature">(static) </span>dayOfWeekBefore<span class="signature">(fragment, day)</span><span class="type-signature"> &rarr; {Array}</span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>day</code></td> <td class="type"> <span class="param-type">Number</span> | <span class="param-type">String</span> </td> <td class="description last">Number between 1 and 7 or string between "Monday" and "Sunday"</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3432">line 3432</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.dayOfWeekBefore("my.product.releaseDate", "Wednesday")</code></pre> <h4 class="name" id=".fulltext"><span class="type-signature">(static) </span>fulltext<span class="signature">(fragment, value)</span><span class="type-signature"> &rarr; {Array}</span></h4> <div class="description"> Build a "fulltext" predicate: fulltext search in a fragment. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">the term to search</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3280">line 3280</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> an array corresponding to the predicate </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.fulltext("my.article.body", "sausage"])</code></pre> <h4 class="name" id=".gt"><span class="type-signature">(static) </span>gt<span class="signature">(fragment, value)</span><span class="type-signature"> &rarr; {Array}</span></h4> <div class="description"> Build a "number.gt" predicate: documents where the fragment field is greater than the given value. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">the name of the field - must be a number.</td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">the lower bound of the predicate</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3304">line 3304</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> an array corresponding to the predicate </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.gt("my.product.price", 10)</code></pre> <h4 class="name" id=".has"><span class="type-signature">(static) </span>has<span class="signature">(fragment)</span><span class="type-signature"> &rarr; {Array}</span></h4> <div class="description"> Build a "has" predicate: documents where the requested field is defined </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3244">line 3244</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> an array corresponding to the predicate </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.has("my.blog-post.author")</code></pre> <h4 class="name" id=".hour"><span class="type-signature">(static) </span>hour<span class="signature">(fragment, hour)</span><span class="type-signature"> &rarr; {Array}</span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>hour</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3488">line 3488</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.hour("my.product.releaseDate", 12)</code></pre> <h4 class="name" id=".hourAfter"><span class="type-signature">(static) </span>hourAfter<span class="signature">(fragment, hour)</span><span class="type-signature"> &rarr; {Array}</span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>hour</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3510">line 3510</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.hourAfter("my.product.releaseDate", 12)</code></pre> <h4 class="name" id=".hourBefore"><span class="type-signature">(static) </span>hourBefore<span class="signature">(fragment, hour)</span><span class="type-signature"> &rarr; {Array}</span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>hour</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3499">line 3499</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.hourBefore("my.product.releaseDate", 12)</code></pre> <h4 class="name" id=".in"><span class="type-signature">(static) </span>in<span class="signature">(fragment, values)</span><span class="type-signature"> &rarr; {Array}</span></h4> <div class="description"> Build an "in" predicate: equality of a fragment to a value. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>values</code></td> <td class="type"> <span class="param-type">Array</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3268">line 3268</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> an array corresponding to the predicate </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.in("my.product.price", [4, 5])</code></pre> <h4 class="name" id=".inRange"><span class="type-signature">(static) </span>inRange<span class="signature">(fragment, before, after)</span><span class="type-signature"> &rarr; {Array}</span></h4> <div class="description"> Build a "number.inRange" predicate: combination of lt and gt. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">the name of the field - must be a number.</td> </tr> <tr> <td class="name"><code>before</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>after</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3329">line 3329</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> an array corresponding to the predicate </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.inRange("my.product.price", 10, 20)</code></pre> <h4 class="name" id=".lt"><span class="type-signature">(static) </span>lt<span class="signature">(fragment, value)</span><span class="type-signature"> &rarr; {Array}</span></h4> <div class="description"> Build a "number.lt" predicate: documents where the fragment field is lower than the given value. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">the name of the field - must be a number.</td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">the upper bound of the predicate</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3316">line 3316</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> an array corresponding to the predicate </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.lt("my.product.price", 20)</code></pre> <h4 class="name" id=".missing"><span class="type-signature">(static) </span>missing<span class="signature">(fragment)</span><span class="type-signature"> &rarr; {Array}</span></h4> <div class="description"> Build a "missing" predicate: documents where the requested field is empty </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3233">line 3233</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> an array corresponding to the predicate </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.missing("my.blog-post.author")</code></pre> <h4 class="name" id=".month"><span class="type-signature">(static) </span>month<span class="signature">(fragment, month)</span><span class="type-signature"> &rarr; {Array}</span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>month</code></td> <td class="type"> <span class="param-type">Number</span> | <span class="param-type">String</span> </td> <td class="description last">Number between 1 and 12 or string between "January" and "December"</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3443">line 3443</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.month("my.product.releaseDate", "June")</code></pre> <h4 class="name" id=".monthAfter"><span class="type-signature">(static) </span>monthAfter<span class="signature">(fragment, month)</span><span class="type-signature"> &rarr; {Array|Array}</span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>month</code></td> <td class="type"> <span class="param-type">Number</span> | <span class="param-type">String</span> </td> <td class="description last">Number between 1 and 12 or string between "January" and "December"</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3466">line 3466</a> </li></ul></dd> </dl> <h5>Returns:</h5> <ul> <li> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> </li> <li> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> </li> </ul> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.monthAfter("my.product.releaseDate", "June")</code></pre> <h4 class="name" id=".monthBefore"><span class="type-signature">(static) </span>monthBefore<span class="signature">(fragment, month)</span><span class="type-signature"> &rarr; {Array}</span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>month</code></td> <td class="type"> <span class="param-type">Number</span> | <span class="param-type">String</span> </td> <td class="description last">Number between 1 and 12 or string between "January" and "December"</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3454">line 3454</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.monthBefore("my.product.releaseDate", "June")</code></pre> <h4 class="name" id=".near"><span class="type-signature">(static) </span>near<span class="signature">(fragment, latitude, longitude, radius)</span><span class="type-signature"> &rarr; {Array}</span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fragment</code></td> <td class="type"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>latitude</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>longitude</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>radius</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">in kilometers</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="prismic.io.js.html">prismic.io.js</a>, <a href="prismic.io.js.html#line3523">line 3523</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Array</span> </dd> </dl> <h5>Example</h5> <pre class="prettyprint"><code>Predicates.near("my.store.location", 48.8768767, 2.3338802, 10)</code></pre> <h4 class="name" id=".not"><span class="type-signature">(static) </span>not<span class="signature">(fragment, value)</span><span class="type-signature"> &rarr; {Array}</span></h4> <div class="description"> Build an "not" predicate: inequality of a fragment to a value. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Na