Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bump to BSON 6.2.0, make string quoting consistent MONGOSH-1452 #1708

Merged
merged 4 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/browser-repl/src/components/utils/inspect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('inspect', function () {
it('inspects UUID', function () {
expect(
inspect(bson.Binary.createFromBase64('YWJjZGVmZ2hpa2xtbm9wcQ==', 4))
).to.equal('UUID("61626364-6566-6768-696b-6c6d6e6f7071")');
).to.equal("UUID('61626364-6566-6768-696b-6c6d6e6f7071')");
});

it('inspects nested ObjectId', function () {
Expand All @@ -57,7 +57,7 @@ describe('inspect', function () {
inspect({
p: bson.Binary.createFromBase64('YWJjZGVmZ2hpa2xtbm9wcQ==', 4),
})
).to.equal('{ p: UUID("61626364-6566-6768-696b-6c6d6e6f7071") }');
).to.equal("{ p: UUID('61626364-6566-6768-696b-6c6d6e6f7071') }");
});

it('does not require BSON types to be instances of the current bson library', function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-runtime-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@mongodb-js/prettier-config-devtools": "^1.0.1",
"@mongodb-js/tsconfig-mongosh": "^1.0.0",
"@mongosh/types": "0.0.0-dev.0",
"bson": "^6.1.0",
"bson": "^6.2.0",
"depcheck": "^1.4.3",
"eslint": "^7.25.0",
"prettier": "^2.8.8",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-repl/src/cli-repl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ describe('CliRepl', function () {
cliRepl,
await testServer.connectionString()
);
expect(output).to.match(/Inserted: ObjectId\("[a-z0-9]{24}"\)/);
expect(output).to.match(/Inserted: ObjectId\('[a-z0-9]{24}'\)/);
expect(exitCode).to.equal(0);
});

Expand All @@ -1596,7 +1596,7 @@ describe('CliRepl', function () {
cliRepl,
await testServer.connectionString()
);
expect(output).to.match(/Inserted: ObjectId\("[a-z0-9]{24}"\)/);
expect(output).to.match(/Inserted: ObjectId\('[a-z0-9]{24}'\)/);
expect(exitCode).to.equal(0);
});

Expand All @@ -1614,7 +1614,7 @@ describe('CliRepl', function () {

cliRepl = new CliRepl(cliReplOptions);
await cliRepl.start(await testServer.connectionString(), {});
expect(output).to.match(/Inserted: ObjectId\("[a-z0-9]{24}"\)/);
expect(output).to.match(/Inserted: ObjectId\('[a-z0-9]{24}'\)/);
expect(exitCode).to.equal(null);

input.write(
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-repl/src/format-output.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ for (const colors of [false, true]) {
context('when the result is a date', function () {
it('returns the inspection', function () {
expect(format({ value: new Date(1234567890000) })).to.include(
'ISODate("2009-02-13T23:31:30.000Z")'
"ISODate('2009-02-13T23:31:30.000Z')"
);
expect(format({ value: new Date(NaN) })).to.include('Invalid Date');
});
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-repl/src/format-output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ function dateInspect(this: Date, depth: number, options: any): string {
if (isNaN(this.valueOf())) {
return options.stylize('Invalid Date', 'date');
}
return `ISODate("${this.toISOString()}")`;
return `ISODate('${this.toISOString()}')`;
}

function inspect(output: any, options: FormatOptions): any {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-repl/src/mongosh-repl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ describe('MongoshNodeRepl', function () {
it('prints Date objects using the ISODate constructor variant', async function () {
input.write('new Date(1620143373000)\n');
await waitEval(bus);
expect(output).to.include('ISODate("2021-05-04T15:49:33.000Z")');
expect(output).to.include("ISODate('2021-05-04T15:49:33.000Z')");
});

it('handles a long series of errors', async function () {
Expand Down
Loading