@InterfaceStability.Experimental @InterfaceAudience.Public public class JsonFunctions extends Object
DSL for N1QL functions in the JSON category.
Constructor and Description |
---|
JsonFunctions() |
Modifier and Type | Method and Description |
---|---|
static Expression |
decodeJson(Expression expression)
The returned Expression unmarshals the expression representing a JSON-encoded string into a N1QL value.
|
static Expression |
decodeJson(JsonObject json)
The returned Expression unmarshals the JSON constant into a N1QL value.
|
static Expression |
decodeJson(String jsonString)
The returned Expression unmarshals the JSON-encoded string into a N1QL value.
|
static Expression |
encodedSize(Expression expression)
Returned expression results in the number of bytes in an uncompressed JSON encoding of the value.
|
static Expression |
encodedSize(String expression)
Returned expression results in the number of bytes in an uncompressed JSON encoding of the value.
|
static Expression |
encodeJson(Expression expression)
Returned expression marshals the N1QL value into a JSON-encoded string.
|
static Expression |
encodeJson(String expression)
Returned expression marshals the N1QL value into a JSON-encoded string.
|
static Expression |
polyLength(Expression expression)
Returned expression results in length of the value after evaluating the expression.
|
static Expression |
polyLength(String expression)
Returned expression results in length of the value after evaluating the expression.
|
public static Expression decodeJson(Expression expression)
The returned Expression unmarshals the expression representing a JSON-encoded string into a N1QL value. The empty string results in MISSING.
public static Expression decodeJson(JsonObject json)
The returned Expression unmarshals the JSON constant into a N1QL value. The empty string results in MISSING.
public static Expression decodeJson(String jsonString)
The returned Expression unmarshals the JSON-encoded string into a N1QL value. The empty string results in MISSING.
The string must represent JSON object marshalled into a JSON String, eg. “{"test": true}” (excluding surrounding quotes).
public static Expression encodeJson(Expression expression)
Returned expression marshals the N1QL value into a JSON-encoded string. MISSING becomes the empty string.
public static Expression encodeJson(String expression)
Returned expression marshals the N1QL value into a JSON-encoded string. MISSING becomes the empty string.
public static Expression encodedSize(Expression expression)
Returned expression results in the number of bytes in an uncompressed JSON encoding of the value. The exact size is implementation-dependent. Always returns an integer, and never MISSING or NULL. Returns 0 for MISSING.
public static Expression encodedSize(String expression)
Returned expression results in the number of bytes in an uncompressed JSON encoding of the value. The exact size is implementation-dependent. Always returns an integer, and never MISSING or NULL. Returns 0 for MISSING.
public static Expression polyLength(Expression expression)
Returned expression results in length of the value after evaluating the expression. The exact meaning of length depends on the type of the value:
public static Expression polyLength(String expression)
Returned expression results in length of the value after evaluating the expression. The exact meaning of length depends on the type of the value:
Copyright © 2014 Couchbase, Inc.