Comparing version 6.8.0-dev.20240904.sha.fb13ebfd to 6.8.0-dev.20240905.sha.65e0e15c
@@ -453,4 +453,2 @@ "use strict"; | ||
* | ||
* @experimental The Range algorithm is experimental only. It is not intended for production use. It is subject to breaking changes. | ||
* | ||
* @param expression - a BSON document of one of the following forms: | ||
@@ -457,0 +455,0 @@ * 1. A Match Expression of this form: |
@@ -208,8 +208,17 @@ "use strict"; | ||
toObject(options) { | ||
return bson_1.BSON.deserialize(this.bson, { | ||
...options, | ||
const exactBSONOptions = { | ||
...(0, bson_1.pluckBSONSerializeOptions)(options ?? {}), | ||
validation: this.parseBsonSerializationOptions(options), | ||
index: this.offset, | ||
allowObjectSmallerThanBufferSize: true | ||
}); | ||
}; | ||
return (0, bson_1.deserialize)(this.bson, exactBSONOptions); | ||
} | ||
parseBsonSerializationOptions(options) { | ||
const enableUtf8Validation = options?.enableUtf8Validation; | ||
if (enableUtf8Validation === false) { | ||
return { utf8: false }; | ||
} | ||
return { utf8: { writeErrors: false } }; | ||
} | ||
/** Returns this document's bytes only */ | ||
@@ -216,0 +225,0 @@ toBytes() { |
@@ -111,16 +111,2 @@ "use strict"; | ||
} | ||
toObject(options) { | ||
const exactBSONOptions = { | ||
...(0, bson_1.pluckBSONSerializeOptions)(options ?? {}), | ||
validation: this.parseBsonSerializationOptions(options) | ||
}; | ||
return super.toObject(exactBSONOptions); | ||
} | ||
parseBsonSerializationOptions(options) { | ||
const enableUtf8Validation = options?.enableUtf8Validation; | ||
if (enableUtf8Validation === false) { | ||
return { utf8: false }; | ||
} | ||
return { utf8: { writeErrors: false } }; | ||
} | ||
} | ||
@@ -127,0 +113,0 @@ exports.MongoDBResponse = MongoDBResponse; |
{ | ||
"name": "mongodb", | ||
"version": "6.8.0-dev.20240904.sha.fb13ebfd", | ||
"version": "6.8.0-dev.20240905.sha.65e0e15c", | ||
"description": "The official MongoDB driver for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -614,4 +614,2 @@ import type { | ||
* | ||
* @experimental The Range algorithm is experimental only. It is not intended for production use. It is subject to breaking changes. | ||
* | ||
* @param expression - a BSON document of one of the following forms: | ||
@@ -773,9 +771,7 @@ * 1. A Match Expression of this form: | ||
/** | ||
* The query type supported. Only the queryType `equality` is stable. | ||
* | ||
* @experimental Public Technical Preview: The queryType `rangePreview` is experimental. | ||
* The query type. | ||
*/ | ||
queryType?: 'equality' | 'range'; | ||
/** @experimental Public Technical Preview: The index options for a Queryable Encryption field supporting "rangePreview" queries.*/ | ||
/** The index options for a Queryable Encryption field supporting "range" queries.*/ | ||
rangeOptions?: RangeOptions; | ||
@@ -968,3 +964,3 @@ } | ||
* @public | ||
* RangeOptions specifies index options for a Queryable Encryption field supporting "rangePreview" queries. | ||
* RangeOptions specifies index options for a Queryable Encryption field supporting "range" queries. | ||
* min, max, sparsity, trimFactor and range must match the values set in the encryptedFields of the destination collection. | ||
@@ -971,0 +967,0 @@ * For double and decimal128, min/max/precision must all be set, or all be unset. |
import { | ||
Binary, | ||
BSON, | ||
type BSONElement, | ||
@@ -8,2 +7,3 @@ BSONError, | ||
BSONType, | ||
deserialize, | ||
getBigInt64LE, | ||
@@ -14,2 +14,3 @@ getFloat64LE, | ||
parseToElementsToArray, | ||
pluckBSONSerializeOptions, | ||
Timestamp, | ||
@@ -335,9 +336,21 @@ toUTF8 | ||
public toObject(options?: BSONSerializeOptions): Record<string, any> { | ||
return BSON.deserialize(this.bson, { | ||
...options, | ||
const exactBSONOptions = { | ||
...pluckBSONSerializeOptions(options ?? {}), | ||
validation: this.parseBsonSerializationOptions(options), | ||
index: this.offset, | ||
allowObjectSmallerThanBufferSize: true | ||
}); | ||
}; | ||
return deserialize(this.bson, exactBSONOptions); | ||
} | ||
private parseBsonSerializationOptions(options?: { enableUtf8Validation?: boolean }): { | ||
utf8: { writeErrors: false } | false; | ||
} { | ||
const enableUtf8Validation = options?.enableUtf8Validation; | ||
if (enableUtf8Validation === false) { | ||
return { utf8: false }; | ||
} | ||
return { utf8: { writeErrors: false } }; | ||
} | ||
/** Returns this document's bytes only */ | ||
@@ -344,0 +357,0 @@ toBytes() { |
@@ -8,3 +8,2 @@ import { | ||
parseToElementsToArray, | ||
pluckBSONSerializeOptions, | ||
type Timestamp | ||
@@ -170,20 +169,2 @@ } from '../../bson'; | ||
} | ||
public override toObject(options?: BSONSerializeOptions): Record<string, any> { | ||
const exactBSONOptions = { | ||
...pluckBSONSerializeOptions(options ?? {}), | ||
validation: this.parseBsonSerializationOptions(options) | ||
}; | ||
return super.toObject(exactBSONOptions); | ||
} | ||
private parseBsonSerializationOptions(options?: { enableUtf8Validation?: boolean }): { | ||
utf8: { writeErrors: false } | false; | ||
} { | ||
const enableUtf8Validation = options?.enableUtf8Validation; | ||
if (enableUtf8Validation === false) { | ||
return { utf8: false }; | ||
} | ||
return { utf8: { writeErrors: false } }; | ||
} | ||
} | ||
@@ -190,0 +171,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3407654
71085