mirror of
https://github.com/wassname/talk.git
synced 2026-07-02 09:22:01 +08:00
Merge pull request #1715 from coralproject/custom-displayname
Search - Display Name
This commit is contained in:
@@ -110,6 +110,13 @@ const getUsersByQuery = async (
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// Search by the displayName metadata field.
|
||||
{
|
||||
'metadata.displayName': {
|
||||
$regex,
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -235,6 +235,15 @@ User.index({
|
||||
created_at: -1,
|
||||
});
|
||||
|
||||
User.index(
|
||||
{
|
||||
'metadata.displayName': 1,
|
||||
},
|
||||
{
|
||||
sparse: true,
|
||||
}
|
||||
);
|
||||
|
||||
// This query is executed often, to count the number of flagged accounts with
|
||||
// usernames.
|
||||
User.index({
|
||||
|
||||
Reference in New Issue
Block a user