feat: added support for metadata.displayName for searches

This commit is contained in:
Wyatt Johnson
2018-06-29 11:17:21 -06:00
parent b9828bcf11
commit 50b920b799
2 changed files with 16 additions and 0 deletions
+7
View File
@@ -110,6 +110,13 @@ const getUsersByQuery = async (
},
},
},
// Search by the displayName metadata field.
{
'metadata.displayName': {
$regex,
},
},
],
});
}
+9
View File
@@ -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({