Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试按 dateCreated desc 对集合进行排序,但我似乎做不到。
到目前为止我已经尝试过:
postOrder.sort({ dateCreated: 'desc' }) postOrder.sort(dateCreated: 'asc')
有任何想法吗??
试试这个:
postOrder.sort{ it.dateCreated } //asc postOrder.sort{ it.dateCreated }.reverse() //desc