search improvements

This commit is contained in:
Phillip Thelen
2024-08-19 16:15:14 +02:00
parent 2b328c37f7
commit e387585d6d
2 changed files with 44 additions and 16 deletions

View File

@@ -42,9 +42,9 @@ api.getHero = {
query = {
$or: [
{ 'auth.local.email': { $regex: re, $options: 'i' } },
{ 'auth.google.email': { $regex: re, $options: 'i' } },
{ 'auth.apple.email': { $regex: re, $options: 'i' } },
{ 'auth.facebook.email': { $regex: re, $options: 'i' } },
{ 'auth.google.emails.value': { $regex: re, $options: 'i' } },
{ 'auth.apple.emails.value': { $regex: re, $options: 'i' } },
{ 'auth.facebook.emails.value': { $regex: re, $options: 'i' } },
],
};
} else {
@@ -55,6 +55,7 @@ api.getHero = {
.find(query)
.select('contributor backer profile auth')
.limit(30)
.sort({ 'auth.timestamps.loggedin': 1 })
.lean()
.exec();
res.respond(200, users);