Skip to content

Conversation

@depfu
Copy link

@depfu depfu bot commented Sep 19, 2025


Welcome to Depfu πŸ‘‹

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!


Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ mongodb (6.3.0 β†’ 6.20.0) Β· Repo Β· Changelog

Release Notes

Too many releases to show here. View the full release notes.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ @​mongodb-js/saslprep (indirect, 1.1.1 β†’ 1.3.0) Β· Repo Β· Changelog

↗️ @​types/whatwg-url (indirect, 11.0.3 β†’ 11.0.5) Β· Repo

Sorry, we couldn't find anything useful about this release.

↗️ bson (indirect, 6.2.0 β†’ 6.10.4) Β· Repo Β· Changelog

Release Notes

6.10.4

6.10.4 (2025-06-02)

The MongoDB Node.js team is pleased to announce version 6.10.4 of the bson package!

Release Notes

Top-Level Await removed from the browser BSON bundle

In versions <6.10.4, BSON uses a top-level await to asynchronously import the crypto module. This change unintentionally caused headaches for users of webpack, react native, vite and other tools bundlers and tools.

The top-level await has been removed from all BSON bundles. Thanks to @lourd for this contribution.

Prevent the creation of incorrectly sized float32 vectors

This adds validation to our BSON.serialize and EJSON.stringify methods that will prevent creating float 32 vectors that are not a multiple of 4. Previously created vectors that do not meet this validation will still be deserialized and parsed so they can be fixed.

Additionally, the toFloat32Array(), toInt8Array(), and toPackedBits() methods now perform the same validation that serialize does to prevent use of incorrectly formatted Binary vector values. (For example, a packed bits vector with more than 7 bits of padding)

Vectors of an incorrect length could only be made manually (directly constructing the bytes and calling new Binary). We recommend using toFloat32Array and fromFloat32Array when interacting with Vectors in MongoDB as they handle the proper creation and translation of this data type.

Bug Fixes

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

6.10.3

6.10.3 (2025-02-19)

The MongoDB Node.js team is pleased to announce version 6.10.3 of the bson package!

Release Notes

⚠️ Fixed potential data corruption bug when useBigInt64 is enabled

After refactoring to improve deserialization performance in #649, we inadvertently introduced a bug that manifested when deserializing Long values with the useBigInt64 flag enabled. The bug would lead to negative Long values being deserialized as unsigned integers. This issue has been resolved here.

Thanks to @rkistner for reporting this bug!

Bug Fixes

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

6.10.2

6.10.2 (2025-01-29)

The MongoDB Node.js team is pleased to announce version 6.10.2 of the bson package!

Release Notes

Fix calculateObjectSize not accounting for BigInt value size

BSON.calculateObjectSize was missing a condition for BigInt values, meaning it did not account for them in the same way that it would for Long values. This has been corrected.

We also added a new default condition that will catch any new values that may be returned by typeof in the future and will throw an error rather than returning an inaccurate size.

Bug Fixes

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

6.10.1

6.10.1 (2024-11-27)

The MongoDB Node.js team is pleased to announce version 6.10.1 of the bson package!

Release Notes

Fix issue with the internal unbounded type cache

As an optimization, a previous performance improvement stored the type information of seen objects to avoid recalculating type information. This caused an issue in the driver under extreme load and high memory usage as the cache grew. The assumption was that garbage collection would clear it enough to sustain normal operation. The cache is now removed and other optimal type checking is used in its place.

Cache the hex string of an ObjectId lazily

When ObjectId.cacheHexString is set to true we no longer convert the buffer to a hex string in the constructor, since the cache is already being filled in any call to objectid.toHexString().

Additionally, if a string is passed into the constructor we can cache this immediately as there is no performance impact and no extra memory that needs to be allocated.

This improves the performance for situations where you are parsing ObjectIds from a string (ex. JSON) and want to avoid recalculating the hex. It also improves situations where you have ObjectIds coming from BSON and only convert some of them strings perhaps after applying some filter to eliminate some.

With cacheHexString enabled deserializing ObjectIds from BSON shows ~80% performance improvement and toString-ing ObjectIds that were constructed from a string convert ~40% faster!

Thanks to @SeanReece for contributing this improvement!

Bug Fixes

Performance Improvements

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

6.10.0

6.10.0 (2024-11-18)

The MongoDB Node.js team is pleased to announce version 6.10.0 of the bson package!

Release Notes

BSON Binary Vector Support!

The Binary class has new helpers to assist with using the newly minted Vector sub_type of Binary sub_type == 9 πŸŽ‰! For more on how these types can be used with MongoDB take a look at How to Ingest Quantized Vectors!

Here's a summary of the API:

class Binary {
  toInt8Array(): Int8Array;
  toFloat32Array(): Float32Array;
  toPackedBits(): Uint8Array;

static fromInt8Array(array: Int8Array): Binary;
static fromFloat32Array(array: Float32Array): Binary;
static fromPackedBits(array: Uint8Array, padding: number = 0): Binary;
}

Relatively self-explanatory: each one supports converting to and constructing from a native Javascript data type that corresponds to one of the three vector types: Int8, Float32, PackedBit.

Vector Bytes Format

When a Binary is sub_type 9 the first two bytes are set to important metadata about the vector.

  • binary.buffer[0] - The datatype that indicates what the following bytes are.
  • binary.buffer[1] - The padding amount, a value 0-7 that indicates how many bits to ignore in a PackedBit vector.

Packed Bits πŸ“¦

static fromPackedBits(array: Uint8Array, padding: number = 0)

When handling packed bits, the last byte may not be entirely used. For example, a PackedBit vector = [0xFF, 0xF0] with padding = 4 ignores those last four 0s making the bit vector logically equal to 12 ones.

    F    F    F    0
[1111 1111 1111]   // ignored: the four 0s are padding

Important

When using the fromPackedBits method to set your padding amount to avoid inadvertently extending your bit vector.

Unpacking Bits 🧳

Packed bits get special treatment with two styles of conversion methods to suit your vector-y needs. toBits will return individually addressable bits shifted apart into an array. fromBits takes the same format in reverse and packs the bits into bytes.

Notice there is no argument to set the padding. That is because it can be determined by the array's length. Recall those 12 ones from the previous example, well, the padding has to be 4 to reach a multiple of 8.

class Binary {
  toBits(): Int8Array;
  static fromBits(bits: ArrayLike<number>): Binary;
}

Caution

We highly encourage using ONLY these methods to interact with vector data and avoid operating directly on the byte format. Other Binary class methods (put(), write() read(), and value()) and direct access of data in a Binary's buffer beyond the 1st index should only be used in exceptional circumstances and with extreme caution after closely consulting the BSON Vector specification.

Details to keep in mind

  • A javascript engine's endianness is platform dependent whereas BSON is always in little-endian format so if viewing bytes as Float32s take care to re-order bytes as needed.
  • Int8 vectors are signed bytes but read() always returns unsigned bytes.
  • The vector data begins at offset 2.

Binary's read() returns a view of Binary.buffer

Binary's read() return type claimed it would return number[] or Uint8Array which was true in previous BSON versions that didn't always store a Uint8Array on the buffer property like Binary does today.

read()'s length parameter did not respect the position value allowing reading bytes beyond the data that is actually stored in the Binary. This has been corrected.

Additionally, this method returned a view in Node.js environments and a copy in Web environments. it has been fixed to always return a view.

Features

Bug Fixes

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

6.9.0

6.9.0 (2024-10-15)

The MongoDB Node.js team is pleased to announce version 6.9.0 of the bson package!

Release Notes

Timestamp now has t and i properties

To make this type a bit easier to use we are surfacing the breakdown of the two internal 32 bit segments of a Timestamp value.

const ts = new Timestamp({ i: 2, t: 1 });
ts.i // 2
ts.t // 1

ObjectId.isValid(string) performance improvement

Often used to validate whether a hex string is the correct length and proper format before constructing an ObjectId for querying, the isValid function will validate strings much faster than before. Many thanks to @SeanReece for the contribution!

Serialization performance improved.

Optimizations have been implemented with respect to BSON serialization across the board, resulting in up to 20% gains in serialization with a sample of MFlix documents. Thanks again to @SeanReece for the contribution!

Features

Performance Improvements

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

6.8.0

6.8.0 (2024-06-27)

The MongoDB Node.js team is pleased to announce version 6.8.0 of the bson package!

Release Notes

Add Signature to Github Releases

The Github release for js-bson now contains a detached signature file for the NPM package (named
bson-X.Y.Z.tgz.sig), on every major and patch release to 6.x and 5.x. To verify the signature, follow the instructions in the 'Release Integrity' section of the README.md file.

Optimize performance of Long.fromBigInt

Internally fromBigInt was originally implemented using toString of the bigint value. Now, Long.fromBigInt has been refactored to use bitwise operations greatly improving performance.

Features

Performance Improvements

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

6.7.0

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 method

The Long.fromStringStrict method is almost identical to the Long.fromString method, except it throws a BSONError if any of the following are true:

  • input string has invalid characters, for the given radix
  • the string contains whitespace
  • the value the input parameters represent is too large or too small to be a 64-bit Long

Unlike Long.fromString, this method does not coerce the inputs '+/-Infinity' and 'NaN' to Long.ZERO, in any case.

Examples:

Long.fromStringStrict('1234xxx5'); // throws BSONError
Long.fromString('1234xxx5'); // coerces input and returns new Long(123400)

// when writing in radix 10, 'n' and 'a' are both invalid characters
Long.fromStringStrict('NaN'); // throws BSONError
Long.fromString('NaN'); // coerces input and returns Long.ZERO

Note

Long.fromStringStrict's functionality will be present in Long.fromString in the V7 BSON release.

Add static Double.fromString method

This method attempts to create an Double type from a string, and will throw a BSONError on any string input that is not representable as a IEEE-754 64-bit double.
Notably, this method will also throw on the following string formats:

  • Strings in non-decimal and non-exponential formats (binary, hex, or octal digits)
  • Strings with characters other than sign, numeric, floating point, or slash characters (Note: 'Infinity', '-Infinity', and 'NaN' input strings are still allowed)
  • Strings with leading and/or trailing whitespace
    Strings with leading zeros, however, are also allowed.

Add static Int32.fromString method

This method attempts to create an Int32 type from string, and will throw a BSONError on any string input that is not representable as an Int32.
Notably, this method will also throw on the following string formats:

  • Strings in non-decimal formats (exponent notation, binary, hex, or octal digits)
  • Strings with non-numeric and non-leading sign characters (ex: '2.0', '24,000')
  • Strings with leading and/or trailing whitespace

Strings with leading zeros, however, are allowed

UTF-8 validation now throws a BSONError on overlong encodings in Node.js

Specifically, 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' to Long.ZERO

Long.fromString no longer coerces the following cases to Long.ZERO when the provided radix supports all characters in the string:

  • '+Infinity', '-Infinity', or 'Infinity' when 35 <= radix <= 36
  • 'NaN' when 24 <= radix <= 36
// when writing in radix 27, 'n' and 'a' are valid characters, so 'NaN' represents the decimal number 17060
Long.fromString('NaN', 27); // new Long(17060)
Long.fromString('NaN', 10); // new Long(0) <-- Since 'NaN' is not a valid input in base 10, it gets coerced to Long.ZERO

Features

Bug Fixes

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

6.6.0

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 and Binary.toJSON align with BSON serialization

When BSON serializes a Binary instance it uses the bytes between 0 and binary.position since Binary supports pre-allocating empty space and writing segments of data using .put()/.write(). Erroneously, the toString() and toJSON() methods did not use the position 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 cases binary.position is equal to the length of the underlying buffer.

Fixed example creating an empty Binary:

new BSON.Binary().toString();
// old output: '\x00\x00\x00\x00...' (256 zeros)
// new output: '' 

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.

6.5.0

6.5.0 (2024-03-12)

The MongoDB Node.js team is pleased to announce version 6.5.0 of the bson package!

Release Notes

Fixed float byte-wise handling on big-endian systems

Caution

Among the platforms BSON and the MongoDB driver support this issue impacts s390x big-endian systems. x86, ARM, and other little-endian systems are not affected. Existing versions of the driver can be upgraded to this release.

A recent change to the BSON library started parsing and serializing floats using a Float64Array. When reading the bytes from this array the ordering is dependent on the platform it is running on and we now properly account for that ordering.

Add SUBTYPE_SENSITIVE on Binary class

When a BSON.Binary object is of 'sensitive' subtype, the object's subtype will equal 0x08.

Features

Bug Fixes

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

6.4.0

6.4.0 (2024-02-29)

The MongoDB Node.js team is pleased to announce version 6.4.0 of the bson package!

Release Notes

BSON short basic latin string writing performance improved!

The BSON library's string encoding logic now attempts to optimize for basic latin (ASCII) characters. This will apply to both BSON keys and BSON values that are or contain strings. If strings are less than 6 bytes we observed approximately 100% increase in speed while around 24 bytes the performance was about 33% better. For any non-basic latin bytes or at 25 bytes or greater the BSON library will continue to use Node.js' Buffer.toString API.

The intent is to generally target the serialization of BSON keys which are often short and only use basic latin.

Fixed objectId symbol property not defined on instances from cross cjs and mjs

We do recommend that users of the driver use the BSON APIs exported from the driver. One reason for this is at this time the driver is only shipped in commonjs format and as a result it will only import the commonjs BSON bundle. If in your application you use import syntax then there will be a commonjs and an es module instance in the current process which prevents things like instanceof from working.

Also, private symbols defined in one package will not be equal to symbols defined in the other. This caused an issue on ObjectId's private symbol property preventing the .equals method from one package from operating on an ObjectId created from another.

Thanks to @dot-i's contribution we've changed the private symbol to a private string property so that the .equals() method works across module types.

Deserialization performance increased

If BSON data does not contain Doubles and UTF8 validation is disabled the deserializer is careful to not allocate data structures needed to support that functionality. This has shown to greatly increase (2x-1.3x) the performance of the deserializer.

Thank you @billouboq for this contribution!

Improve the performance of small byte copies

When serializing ObjectIds, Decimal128, and UUID values we can get better performance by writing the byte-copying logic in Javascript for loops rather than using the TypedArray.set API. ObjectId serialization performance is 1.5x-2x faster.

Improved the performance of serializing and deserializing doubles and bigints

We now use bit shifting and multiplication operators in place of DataView getX/setX calls to parse and serialize bigints and a Float64Array to convert a double to bytes. This change has been shown to increase deserializing performance ~1.3x and serializing performance ~1.75x.

Use allocUnsafe for ObjectIds and Decimal128

For small allocations Node.js performance can be improved by using pre-allocated pooled memory. ObjectIds and Decimal128 instance will now use allocUnsafe on Node.js.

Features

Bug Fixes

  • NODE-5873: objectId symbol property not defined on instances from cross cjs and mjs (#643) (4d9884d)

Performance Improvements

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

6.3.0

6.3.0 (2024-01-31)

The MongoDB Node.js team is pleased to announce version 6.3.0 of the bson package!

Release Notes

BSON short basic latin string parsing performance improved! 🐎

The BSON library's string decoding logic now attempts to optimize for basic latin (ASCII) characters. This will apply to both BSON keys and BSON values that are or contain strings. If strings are less than 6 bytes we observed approximately ~100% increase in speed while around 15 bytes the performance was about ~30% better. For any non-basic latin bytes or at 20 bytes or greater the BSON library will continue to use Node.js' Buffer.toString API.

The intent is to generally target the deserialization of BSON keys which are often short and only use basic latin, Et tu, _id?

Using a number type as input to the ObjectId constructor is deprecated

Instead, use static createFromTime() to set a numeric value for the new ObjectId.

// previously
new ObjectId(Date.now())

// recommended
ObjectId.createFromTime(Date.now())

Features

Documentation

We invite you to try the bson library immediately, and report any issues to the NODE project.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ mongodb-connection-string-url (indirect, 3.0.0 β†’ 3.0.2) Β· Repo Β· Changelog

Release Notes

3.0.2

3.0.2 (2025-01-14)

The MongoDB Node.js team is pleased to announce version 3.0.2 of the mongodb-connection-string-url package!

Release Notes

This release updates the whatwg-url dependency to either be 13.x or 14.x as either works with this package. Ensuring you have 14 installed in your dependency tree should address the deprecation warning related to 'punycode'

We invite you to try the mongodb-connection-string-url library immediately, and report any issues to the NODE project.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ tr46 (indirect, 4.1.1 β†’ 5.1.1) Β· Repo

Release Notes

5.1.1

Fixes the behavior when useSTD3ASCIIRules is set to true. This regressed in v5.1.0. (#70, @yandrushchak)

5.1.0

Updates to Unicode 16.0.0.

Updates to follow TR 46 revision 33 (spec changelog). This did not include any public API changes but did include some logic changes.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ whatwg-url (indirect, 13.0.0 β†’ 14.2.0) Β· Repo

Release Notes

14.2.0

Updated our tr46 dependency, which updates our international domain name support to reflect Unicode 16.0.0. Also includes the related changes to the URL Standard:

Added U+005E (^) to the path percent-encode set, per whatwg/url@9bc33c3.

Ensured opaque paths always roundtrip, per whatwg/url@6c78200.

14.1.1

Improved performance for very long inputs.

14.1.0

Added URL.parse(), per whatwg/url@58acb06.

14.0.0

Breaking change: removed Node.js v16 support.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.


πŸ‘‰ No CI detected

You don't seem to have any Continuous Integration service set up!

Without a service that will test the Depfu branches and pull requests, we can't inform you if incoming updates actually work with your app. We think that this degrades the service we're trying to provide down to a point where it is more or less meaningless.

This is fine if you just want to give Depfu a quick try. If you want to really let Depfu help you keep your app up-to-date, we recommend setting up a CI system:

* [Circle CI](https://circleci.com), [Semaphore ](https://semaphoreci.com) and [Github Actions](https://docs.github.com/actions) are all excellent options. * If you use something like Jenkins, make sure that you're using the Github integration correctly so that it reports status data back to Github. * If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with `depfu/`.

Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfu depfu bot added the depfu label Sep 19, 2025
@depfu depfu bot force-pushed the depfu/update/test/npm/mongodb-6.20.0 branch 9 times, most recently from 0ba1894 to f6eec17 Compare September 22, 2025 18:25
rglover and others added 14 commits September 22, 2025 16:52
…ovement

- Add ProcessingLane class for independent batch processing
- Add BatchedWriteQueue class with 4 parallel processing lanes
- Implement consistent hashing for operation distribution
- Add configurable batch size (100 ops) and timeout (10ms)
- Maintain complete backward compatibility with WriteQueue API
- Add comprehensive test suite with performance benchmarks
- Achieve 33K-45K operations/second throughput
- Support runtime enable/disable with fallback to sequential processing
- Include retry logic, statistics, and graceful shutdown
@depfu depfu bot force-pushed the depfu/update/test/npm/mongodb-6.20.0 branch from f6eec17 to 4fda5a1 Compare September 22, 2025 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants