Partial set index (#14087)

* partial index test

* cleanup

* remove line

* background true

* whitespace

* test: fix invite/pending removal
This commit is contained in:
Barış Uşaklı
2026-03-11 23:49:22 -04:00
committed by GitHub
parent 25f6088f52
commit 79fe0902fe
5 changed files with 67 additions and 19 deletions

View File

@@ -86,6 +86,9 @@ mongoModule.createIndices = async function () {
const collection = mongoModule.client.collection('objects');
await collection.createIndex({ _key: 1, score: -1 }, { background: true });
await collection.createIndex({ _key: 1, value: -1 }, { background: true, unique: true, sparse: true });
await collection.createIndex(
{ members: 1, _key: 1}, { background: true, partialFilterExpression: { members: { $exists: true } } }
);
await collection.createIndex({ expireAt: 1 }, { expireAfterSeconds: 0, background: true });
winston.info('[database] Checking database indices done!');
};