Skip to content

Commit 97b8b2b

Browse files
authored
Merge pull request #10 from powersync-ja/bump-mongodb-driver
Fix "Cannot convert a BigInt value to a number"
2 parents 445365d + 8716106 commit 97b8b2b

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

packages/service-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"ix": "^5.0.0",
3838
"jose": "^4.15.1",
3939
"lru-cache": "^10.2.2",
40-
"mongodb": "^6.5.0",
40+
"mongodb": "^6.7.0",
4141
"node-fetch": "^3.3.2",
4242
"pgwire": "github:kagis/pgwire#f1cb95f9a0f42a612bb5a6b67bb2eb793fc5fc87",
4343
"ts-codec": "^1.2.2",

packages/service-core/src/storage/mongo/db.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ export class PowerSyncMongo {
4545
this.client = client;
4646

4747
const db = client.db(options?.database, {
48-
// Note this issue with useBigInt64: https://jira.mongodb.org/browse/NODE-6165
49-
// Unfortunately there is no workaround if we want to continue using bigint.
50-
// We selectively disable this in individual queries where we don't need that.
5148
...BSON_DESERIALIZE_OPTIONS
5249
});
5350
this.db = db;

packages/service-core/src/storage/mongo/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ export async function readSingleBatch<T>(cursor: mongo.FindCursor<T>): Promise<{
8383
}
8484

8585
export const BSON_DESERIALIZE_OPTIONS: bson.DeserializeOptions = {
86-
// use bigint instead of long
86+
// use bigint instead of Long
8787
useBigInt64: true
8888
};

pnpm-lock.yaml

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

service/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"ix": "^5.0.0",
3232
"jose": "^4.15.1",
3333
"lru-cache": "^10.0.1",
34-
"mongodb": "^6.5.0",
34+
"mongodb": "^6.7.0",
3535
"node-fetch": "^3.3.2",
3636
"pgwire": "github:kagis/pgwire#f1cb95f9a0f42a612bb5a6b67bb2eb793fc5fc87",
3737
"ts-codec": "^1.2.2",

0 commit comments

Comments
 (0)