Class JsonFunctions
java.lang.Object
com.couchbase.client.java.query.dsl.functions.JsonFunctions
@Experimental @Public public class JsonFunctions extends Object
DSL for N1QL functions in the JSON category.
- Since:
- 2.2
- Author:
- Simon Baslé
-
Method Summary
Modifier and Type Method Description static Expression
decodeJson(JsonObject json)
The returned Expression unmarshals the JSON constant into a N1QL value.static Expression
decodeJson(Expression expression)
The returned Expression unmarshals the expression representing a JSON-encoded string 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.
-
Method Details
-
decodeJson
The returned Expression unmarshals the expression representing a JSON-encoded string into a N1QL value. The empty string results in MISSING. -
decodeJson
The returned Expression unmarshals the JSON constant into a N1QL value. The empty string results in MISSING. -
decodeJson
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). -
encodeJson
Returned expression marshals the N1QL value into a JSON-encoded string. MISSING becomes the empty string. -
encodeJson
Returned expression marshals the N1QL value into a JSON-encoded string. MISSING becomes the empty string. -
encodedSize
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. -
encodedSize
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. -
polyLength
Returned expression results in length of the value after evaluating the expression. The exact meaning of length depends on the type of the value: - MISSING: MISSING - NULL: NULL - String: The length of the string. - Array: The number of elements in the array. - Object: The number of name/value pairs in the object - Any other value: NULL. -
polyLength
Returned expression results in length of the value after evaluating the expression. The exact meaning of length depends on the type of the value: - MISSING: MISSING - NULL: NULL - String: The length of the string. - Array: The number of elements in the array. - Object: The number of name/value pairs in the object - Any other value: NULL.
-