New query expressions for data transformation

May 7, 2026

What it is: New aggregation expressions in MongoDB 8.3 for advanced data transformation, including universal string casting ($convert), native JSON-to-BSON parsing, numeric base conversion (binary, hex, etc.), and regex support for string manipulation.

Who it's for: Developers who currently rely on client-side processing or JavaScript functions in database queries to perform data transformation.

Why it matters: Native expressions are significantly more efficient than alternatives based on server-side JavaScript — native regex replacements and object conversions can be up to 30x faster than equivalent $function calls. These additions remove the need for client-side processing or JavaScript workarounds in database queries.
How to get started: Available in MongoDB 8.3 or higher. See the documentation links below.




Related Content

Docs

$convert

Docs

$toArray

Docs

$toObject

Docs

$subType