mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-08 14:42:46 +08:00
optimize friends query by adding status to conenction indicies
This commit is contained in:
parent
4b9e275a13
commit
71ec07a774
1 changed files with 2 additions and 2 deletions
|
@ -195,8 +195,8 @@ function getKey(initiatorUid: string, receiverUid: string): string {
|
|||
|
||||
export async function createIndicies(): Promise<void> {
|
||||
//index used for search
|
||||
await getCollection().createIndex({ initiatorUid: 1 });
|
||||
await getCollection().createIndex({ receiverUid: 1 });
|
||||
await getCollection().createIndex({ initiatorUid: 1, status: 1 });
|
||||
await getCollection().createIndex({ receiverUid: 1, status: 1 });
|
||||
|
||||
//make sure there is only one connection for each initiatorr/receiver
|
||||
await getCollection().createIndex({ key: 1 }, { unique: true });
|
||||
|
|
Loading…
Add table
Reference in a new issue