chore(main): release 6.6.0 [skip-ci] #661
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.6.0 (2024-04-01)
The MongoDB Node.js team is pleased to announce version 6.6.0 of the
bson
package!Release Notes
Binary.toString
andBinary.toJSON
align with BSON serializationWhen BSON serializes a Binary instance it uses the bytes between
0
andbinary.position
since Binary supports pre-allocating empty space and writing segments of data using.put()
/.write()
. Erroneously, thetoString()
andtoJSON()
methods did not use theposition
property to limit how much of the underlying buffer to transform into the final value, potentially returning more string than relates to the actual data of the Binary instance.In general, you may not encounter this bug if
Binary
instances are created from a data source (new Binary(someBuffer)
) or are returned by the database because in both of these casesbinary.position
is equal to the length of the underlying buffer.Fixed example creating an empty Binary:
Experimental APIs
This release contains experimental APIs that are not suitable for production use. As a reminder, anything marked
@experimental
is not a part of the stable semantically versioned API and is subject to change in any subsequent release.Bug Fixes
Documentation
We invite you to try the
bson
library immediately, and report any issues to the NODE project.