mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: add limit to problem.getPrefixList
This commit is contained in:
1 parent
ca670a2f12
commit
10dd5d28d5
5 files changed
+14
-10
No files matched your search
@@ -340,7 +340,8 @@ export class ProblemModel {
|
||||
prefix = prefix.toLowerCase();
|
||||
const $regex = new RegExp(`\\A${escapeRegExp(prefix)}`, 'gmi');
|
||||
const filter = { $or: [{ pid: { $regex } }, { title: { $regex } }] };
|
||||
return await document.getMulti(domainId, document.TYPE_PROBLEM, filter, ['domainId', 'docId', 'pid', 'title']).toArray();
|
||||
return await document.getMulti(domainId, document.TYPE_PROBLEM, filter, ['domainId', 'docId', 'pid', 'title'])
|
||||
.limit(20).toArray();
|
||||
}
|
||||
|
||||
static async getListStatus(domainId: string, uid: number, pids: number[]) {
|
||||
|
||||
Reference in new issue
Block a user