Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.33 KB

File metadata and controls

54 lines (37 loc) · 1.33 KB
title titleSuffix description author ms.author ms.reviewer ms.service ms.subservice ms.topic ms.devlang ms.date ms.custom
RIGHT
Azure Cosmos DB for NoSQL
An Azure Cosmos DB for NoSQL system function that returns a substring from the right side of a string.
jcodella
jacodel
sidandrews
cosmos-db
nosql
reference
nosql
02/27/2024
query-reference

RIGHT (NoSQL query)

[!INCLUDENoSQL]

Returns the right part of a string up to the specified number of characters.

Syntax

RIGHT(<string_expr>, <numeric_expr>)  

Arguments

Description
string_expr A string expression.
numeric_expr A numeric expression specifying the number of characters to extract from string_expr.

Return types

Returns a string expression.

Examples

The following example returns the right part of the string Microsoft for various length values.

:::code language="nosql" source="~/cosmos-db-nosql-query-samples/scripts/right/query.sql" highlight="2-6":::

:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/right/result.json":::

Remarks

Related content