Skip to content

Commit 293765d

Browse files
authored
Fix clearing bucket parameters [main] (#246)
* Fix deleteMany for bucket_parameters to use an index. * Add changeset.
2 parents 53e7a1e + 3bd6f94 commit 293765d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/gentle-coins-lie.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@powersync/service-module-mongodb-storage': patch
3+
'@powersync/service-core': patch
4+
'@powersync/service-image': patch
5+
---
6+
7+
Fix slow clearing of bucket_parameters collection.

modules/module-mongodb-storage/src/storage/implementation/MongoSyncBucketStorage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ export class MongoSyncBucketStorage
571571
);
572572
await this.db.bucket_parameters.deleteMany(
573573
{
574-
key: idPrefixFilter<SourceKey>({ g: this.group_id }, ['t', 'k'])
574+
'key.g': this.group_id
575575
},
576576
{ maxTimeMS: lib_mongo.db.MONGO_CLEAR_OPERATION_TIMEOUT_MS }
577577
);

0 commit comments

Comments
 (0)