<p>我想先得到最新的帖子,然后尝试以下操作:</p>
<pre><code>db.posts.find({"date": {"$lt": tomorrow, "$gte":
today}}).sort({'date':pymongo.DESCENDING})
</code></pre>
<p>(如果没有排序,我会先得到最旧的帖子)</p>
<p>我发现了这个错误</p>
<pre><code>TypeError: if no direction is specified, key_or_list must be an instance of list
</code></pre>
<p>这是怎么回事?不能按日期排序吗?</p>