Skip to content

Commit ec5a53a

Browse files
Merge branch 'main' into NODE-6060/fire-and-forget
2 parents ebd4b44 + 27fd8a0 commit ec5a53a

File tree

11 files changed

+300
-86
lines changed

11 files changed

+300
-86
lines changed

.github/workflows/build_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build and commit docs
22

33
on:
44
push:
5-
branches: [main]
5+
branches: ['main']
66

77
permissions:
88
contents: write

.github/workflows/release-5.x.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [5.x]
3+
branches: ['5.x']
44
workflow_dispatch: {}
55

66
permissions:
@@ -19,7 +19,7 @@ jobs:
1919
- id: release
2020
uses: googleapis/release-please-action@v4
2121
with:
22-
target-branch: 5.x
22+
target-branch: '5.x'
2323

2424
build:
2525
needs: [release_please]
@@ -75,7 +75,7 @@ jobs:
7575
with:
7676
release_version: ${{ env.package_version }}
7777
product_name: mongodb
78-
sarif_report_target_ref: 5.x
78+
sarif_report_target_ref: '5.x'
7979
third_party_dependency_tool: n/a
8080
dist_filenames: artifacts/*
8181
token: ${{ github.token }}

.github/workflows/release-6.8.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [6.8]
3+
branches: ['6.8']
44
workflow_dispatch: {}
55

66
permissions:
@@ -19,11 +19,11 @@ jobs:
1919
- id: release
2020
uses: googleapis/release-please-action@v4
2121
with:
22-
target-branch: 6.8
22+
target-branch: '6.8'
2323

2424
build:
2525
needs: [release_please]
26-
name: "Perform any build or bundling steps, as necessary."
26+
name: 'Perform any build or bundling steps, as necessary.'
2727
uses: ./.github/workflows/build.yml
2828

2929
ssdlc:
@@ -75,7 +75,7 @@ jobs:
7575
with:
7676
release_version: ${{ env.package_version }}
7777
product_name: mongodb
78-
sarif_report_target_ref: 6.8
78+
sarif_report_target_ref: '6.8'
7979
third_party_dependency_tool: n/a
8080
dist_filenames: artifacts/*
8181
token: ${{ github.token }}

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [main]
3+
branches: ['main']
44
workflow_dispatch: {}
55

66
permissions:
@@ -19,7 +19,7 @@ jobs:
1919
- id: release
2020
uses: googleapis/release-please-action@v4
2121
with:
22-
target-branch: main
22+
target-branch: 'main'
2323

2424
build:
2525
needs: [release_please]
@@ -75,7 +75,7 @@ jobs:
7575
with:
7676
release_version: ${{ env.package_version }}
7777
product_name: mongodb
78-
sarif_report_target_ref: main
78+
sarif_report_target_ref: 'main'
7979
third_party_dependency_tool: n/a
8080
dist_filenames: artifacts/*
8181
token: ${{ github.token }}

src/client-side-encryption/client_encryption.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,6 @@ export class ClientEncryption {
611611
*
612612
* Only supported when queryType is "range" and algorithm is "Range".
613613
*
614-
* @experimental The Range algorithm is experimental only. It is not intended for production use. It is subject to breaking changes.
615-
*
616614
* @param expression - a BSON document of one of the following forms:
617615
* 1. A Match Expression of this form:
618616
* `{$and: [{<field>: {$gt: <value1>}}, {<field>: {$lt: <value2> }}]}`
@@ -769,13 +767,11 @@ export interface ClientEncryptionEncryptOptions {
769767
contentionFactor?: bigint | number;
770768

771769
/**
772-
* The query type supported. Only the queryType `equality` is stable.
773-
*
774-
* @experimental Public Technical Preview: The queryType `rangePreview` is experimental.
770+
* The query type.
775771
*/
776772
queryType?: 'equality' | 'range';
777773

778-
/** @experimental Public Technical Preview: The index options for a Queryable Encryption field supporting "rangePreview" queries.*/
774+
/** The index options for a Queryable Encryption field supporting "range" queries.*/
779775
rangeOptions?: RangeOptions;
780776
}
781777

@@ -963,7 +959,7 @@ export interface ClientEncryptionRewrapManyDataKeyResult {
963959

964960
/**
965961
* @public
966-
* RangeOptions specifies index options for a Queryable Encryption field supporting "rangePreview" queries.
962+
* RangeOptions specifies index options for a Queryable Encryption field supporting "range" queries.
967963
* min, max, sparsity, trimFactor and range must match the values set in the encryptedFields of the destination collection.
968964
* For double and decimal128, min/max/precision must all be set, or all be unset.
969965
*/

src/cmap/wire_protocol/on_demand/document.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import {
22
Binary,
3-
BSON,
43
type BSONElement,
54
BSONError,
65
type BSONSerializeOptions,
76
BSONType,
7+
deserialize,
88
getBigInt64LE,
99
getFloat64LE,
1010
getInt32LE,
1111
ObjectId,
1212
parseToElementsToArray,
13+
pluckBSONSerializeOptions,
1314
Timestamp,
1415
toUTF8
1516
} from '../../../bson';
@@ -330,11 +331,23 @@ export class OnDemandDocument {
330331
* @param options - BSON deserialization options
331332
*/
332333
public toObject(options?: BSONSerializeOptions): Record<string, any> {
333-
return BSON.deserialize(this.bson, {
334-
...options,
334+
const exactBSONOptions = {
335+
...pluckBSONSerializeOptions(options ?? {}),
336+
validation: this.parseBsonSerializationOptions(options),
335337
index: this.offset,
336338
allowObjectSmallerThanBufferSize: true
337-
});
339+
};
340+
return deserialize(this.bson, exactBSONOptions);
341+
}
342+
343+
private parseBsonSerializationOptions(options?: { enableUtf8Validation?: boolean }): {
344+
utf8: { writeErrors: false } | false;
345+
} {
346+
const enableUtf8Validation = options?.enableUtf8Validation;
347+
if (enableUtf8Validation === false) {
348+
return { utf8: false };
349+
}
350+
return { utf8: { writeErrors: false } };
338351
}
339352

340353
/** Returns this document's bytes only */

src/cmap/wire_protocol/responses.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
type Document,
66
Long,
77
parseToElementsToArray,
8-
pluckBSONSerializeOptions,
98
type Timestamp
109
} from '../../bson';
1110
import { MongoUnexpectedServerResponseError } from '../../error';
@@ -166,24 +165,6 @@ export class MongoDBResponse extends OnDemandDocument {
166165
}
167166
return this.clusterTime ?? null;
168167
}
169-
170-
public override toObject(options?: BSONSerializeOptions): Record<string, any> {
171-
const exactBSONOptions = {
172-
...pluckBSONSerializeOptions(options ?? {}),
173-
validation: this.parseBsonSerializationOptions(options)
174-
};
175-
return super.toObject(exactBSONOptions);
176-
}
177-
178-
private parseBsonSerializationOptions(options?: { enableUtf8Validation?: boolean }): {
179-
utf8: { writeErrors: false } | false;
180-
} {
181-
const enableUtf8Validation = options?.enableUtf8Validation;
182-
if (enableUtf8Validation === false) {
183-
return { utf8: false };
184-
}
185-
return { utf8: { writeErrors: false } };
186-
}
187168
}
188169

189170
/** @internal */

0 commit comments

Comments
 (0)