bson breaking changes
bson 5.0.0 (February 13, 2024) is its newest release with breaking changes, 5 of them. The first: Removed validating_keys. Every breaking API change we have recorded in bson on RubyGems: 12 breaking changes in 4 versions. Below, its 4 versions with breaking changes, newest first, removals and renames first, each with its source.
Updated December 4, 2026
On this page
Latest version 5.2.1, released November 25, 2026. Source repository
Packages on RubyGems run on Ruby. Ruby end of life dates.
- From 4.0.0 to 5.0.0: 5 breaking changes in 1 version.
- From 2.0.0 to 5.0.0: 8 breaking changes in 3 versions.
bson 5.0.0 breaking changes
- Removed
validating_keys
The validating_keys option was removed from the API. Code that sets it must stop doing so. github.com - Behavior changed
BSON.ObjectId.as_json
ObjectId#as_json now returns a String without the '$oid' wrapper. Code that reads the '$oid' key from its output must be updated. github.com - Behavior changed
BSON.ObjectId.to_json
ObjectId#to_json now returns a String without the '$oid' wrapper. Code that reads the '$oid' key from its output must be updated. github.com - Behavior changed
BSON.Regexp.Raw
BSON::Regexp::Raw no longer accepts integers as options. Code passing integer options must switch to string option flags. github.com - Default changed
BSON.Decimal128
Decimal128 values now deserialize to BigDecimal by default instead of the previous type. Code relying on the old return type must be updated. github.com
bson 4.0.0 breaking changes
- Behavior changed
Ruby Symbols are serialized to String bson types instead of their previous BSON type. Code that depends on the old serialized type must be updated. github.com - Behavior changed
Integer.to_bson_key
Integer#to_bson_key now returns a String instead of its previous result. Code that relies on the old return value must be updated. github.com
bson 3.0.0 breaking changes
- Behavior changed
BSON.Regexp.Raw
Regular expressions that are deserialized now return a BSON::Regexp::Raw instead of a Regexp object. Call #compile on the returned object to get a compiled regular expression. github.com
bson 2.0.0 breaking changes
- Removed
BSON.DEFAULT_MAX_BSON_SIZE
The constant was removed because the BSON specification sets no upper limit on document size. Code that references it will fail. github.com - Removed
BSON.deserialize
Call from_bson on Hash or BSON::Document with a StringIO instead of BSON.deserialize. github.com - Removed
BSON.serialize
Call to_bson on a Hash or BSON::Document instead of BSON.serialize to get the raw bytes of a document. github.com - Behavior changed
to_json
to_json on BSON::Binary, BSON::Code, BSON::CodeWithScope, BSON::MaxKey, BSON::MinKey, BSON::ObjectId, BSON::Timestamp and Regexp now produces the BSON specification format, so code that parses that output must change. github.com
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.