The applet cloud development related,There are 30 messages in the collection,They are sorted in descending order by time
`db.collection ('posts')
.orderBy ('created_at', 'desc')
.skip (posts.length)
.get`
There is no problem at the beginning when the content is less,When testing more things found that the sort is wrong。 The following is the database content is in ascending order, so the obtained content is also ascending order, by descending order the content is inverted.
But because of page-loading, the content obtained in the first page is sorted and displayed. Although the content of the second page is newer than the first page, but is obtained at the back of the first page, it is ranked behind the first page, causing me to post new content, will also be displayed in the back, how to deal with this, please the big guy Solve the confusion.
`db.collection ('posts')
.orderBy ('created_at', 'desc')
.skip (posts.length)
.get`
There is no problem at the beginning when the content is less,When testing more things found that the sort is wrong。 The following is the database content is in ascending order, so the obtained content is also ascending order, by descending order the content is inverted.
But because of page-loading, the content obtained in the first page is sorted and displayed. Although the content of the second page is newer than the first page, but is obtained at the back of the first page, it is ranked behind the first page, causing me to post new content, will also be displayed in the back, how to deal with this, please the big guy Solve the confusion.
No comments:
Post a Comment