mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 11:30:13 +08:00
feat: add order to pagination
This commit is contained in:
1 parent
68db16419d
commit
fa36b63fbe
8 files changed
+85
-50
No files matched your search
@@ -14,7 +14,7 @@ export function userCount() {
|
||||
|
||||
export async function userList(pagination) {
|
||||
const users = await Session.aggregate([
|
||||
pagination.matchStage('user'),
|
||||
pagination.match('user'),
|
||||
{
|
||||
$group: {
|
||||
_id: '$user',
|
||||
@@ -31,7 +31,7 @@ export async function userList(pagination) {
|
||||
},
|
||||
},
|
||||
{ $unwind: '$userData' },
|
||||
pagination.order('userData._id'),
|
||||
pagination.sort('userData._id'),
|
||||
pagination.limit(),
|
||||
])
|
||||
|
||||
|
||||
Reference in new issue
Block a user