Skip to content
Back to feed

October 30, 2026 · Google CloudFeature

Spanner supports comparing and sorting JSONB and JSON values

Spanner supports equality and ordering comparisons on JSONB and JSON values. You can use these values in GROUP_BY and ORDER BY clauses without first converting them to another data type.

In GoogleSQL, you can also convert other data types to JSON using CAST(expression AS JSON) and compare JSON values directly with non-JSON values. Spanner can implicitly coerces the non-JSON value to JSON for comparison.

Additionally, you can use search indexes to accelerate equality comparisons such as = or IN on JSONB and JSON columns and subpaths.

For more information, see JSON comparison and sorting , JSON comparison coercion , CAST AS JSON , JSON search indexes , and Working with JSONB.

Text from the Google Cloud release notes, licensed under CC BY 4.0. Source: Google Cloud release notes.