Skip to main content

codepoint

Description

Converts a Unicode character into its numeric code point representation.

Syntax

Like many functions in DataPrime, codepoint supports two notations, function and method. These interchangeable forms allow flexibility in how you structure expressions.

codepoint(value: string): number

Arguments

NameTypeRequiredDescription
valuestringtrueThe Unicode character to convert into a numeric code point

Example

Convert a Unicode character into its numeric representation

Using codepoint, the character can be translated into its numeric value. Consider the following document:

Example data

{
"emoji_value": "❤"
}

Example query

create emoji_numeric_value from codepoint(emoji_value)

Example output

{
"emoji_value": "❤",
"emoji_numeric_value": 10084
}
Was this page helpful?