mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
21 lines
1 KiB
HTML
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) ->
|
|
</code></pre>
|
|
</p>
|
|
</div>
|
|
|
|
<ul>
|
|
</ul>
|