Meteor.js: Find all documents and return in reverse natural order

前端 未结 4 744
栀梦
栀梦 2021-01-05 05:10

I am trying to return all documents in a collection, to use it with an {{#each}} in my template. My code looks like this:

return Answers.find({}, {sort: {$nat

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-05 05:45

    As a workaround you could do this:

    return Answers.find().fetch().reverse();
    

    I know it would be nicer to do it via the sort parameter, but I don't think it's possible right now.

提交回复
热议问题