chore(main): release 6.7.0 [skip-ci] #672
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🌱 A new release!
6.7.0 (2024-05-01)
The MongoDB Node.js team is pleased to announce version 6.7.0 of the
bson
package!Release Notes
Add
Long.fromStringStrict
methodThe
Long.fromStringStrict
method is almost identical to theLong.fromString
method, except it throws aBSONError
if any of the following are true:Unlike
Long.fromString
, this method does not coerce the inputs'+/-Infinity'
and'NaN'
toLong.ZERO
, in any case.Examples:
Note
Long.fromStringStrict
's functionality will be present inLong.fromString
in the V7 BSON release.Add static
Double.fromString
methodThis method attempts to create an
Double
type from a string, and will throw aBSONError
on any string input that is not representable as aIEEE-754 64-bit double
.Notably, this method will also throw on the following string formats:
'Infinity'
,'-Infinity'
, and'NaN'
input strings are still allowed)Strings with leading zeros, however, are also allowed.
Add static
Int32.fromString
methodThis method attempts to create an
Int32
type from string, and will throw aBSONError
on any string input that is not representable as anInt32
.Notably, this method will also throw on the following string formats:
Strings with leading zeros, however, are allowed
UTF-8 validation now throws a
BSONError
on overlong encodings in Node.jsSpecifically, this affects
deserialize
when utf8 validation is enabled, which is the default.An overlong encoding is when the number of bytes in an encoding is inflated by padding the code point with leading 0s (see here for more information).
Long.fromString
takes radix into account before coercing '+/-Infinity' and 'NaN' toLong.ZERO
Long.fromString
no longer coerces the following cases toLong.ZERO
when the provided radix supports all characters in the string:'+Infinity'
,'-Infinity'
, or'Infinity'
when 35 <= radix <= 36'NaN'
when 24 <= radix <= 36Features
Bug Fixes
Documentation
We invite you to try the
bson
library immediately, and report any issues to the NODE project.