Mailspring/docs/SortOrder.html
2015-10-03 12:57:50 -07:00

21 lines
1 KiB
HTML

---
layout: docs
title: SortOrder
edit_url: "https://github.com/nylas/N1/blob/master/src/flux/attributes/sort-order.coffee"
---
<h2>Summary</h2>
<div class="markdown-from-sourecode">
<p><p>Represents a particular sort direction on a particular column. You should not
instantiate SortOrders manually. Instead, call <a href='Attribute.html#ascending'>Attribute::ascending</a> or
<a href='Attribute.html#descending'>Attribute::descending</a> to obtain a sort order instance:</p>
<pre><code class="lang-coffee">DatabaseStore.<span class="hljs-function"><span class="hljs-title">findBy</span><span class="hljs-params">(Message)</span></span>
.<span class="hljs-function"><span class="hljs-title">where</span><span class="hljs-params">({threadId: threadId, draft: false})</span></span>
.<span class="hljs-function"><span class="hljs-title">order</span><span class="hljs-params">(Message.attributes.date.descending()</span></span>)<span class="hljs-class">.then</span> (messages) -&gt;
</code></pre>
</p>
</div>
<ul>
</ul>