mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: use case-sensitive query
This commit is contained in:
1 parent
076e2097c0
commit
c5ad6599a8
3 files changed
+3
-5
No files matched your search
@@ -367,8 +367,7 @@ class UserModel {
|
||||
|
||||
@ArgMethod
|
||||
static async getPrefixList(domainId: string, prefix: string, limit: number = 50) {
|
||||
prefix = prefix.toLowerCase();
|
||||
const $regex = new RegExp(`\\A${escapeRegExp(prefix)}`, 'gmi');
|
||||
const $regex = `^${escapeRegExp(prefix.toLowerCase())}`;
|
||||
const udocs = await coll.find({ unameLower: { $regex } })
|
||||
.limit(limit).project({ _id: 1 }).toArray();
|
||||
const users = [];
|
||||
|
||||
Reference in new issue
Block a user