Class JsonNullValue
Inherited Members
Namespace: Oracle.NoSQL.SDK
Assembly: Oracle.NoSQL.SDK.dll
Syntax
public class JsonNullValue : FieldValue
Remarks
Oracle NoSQL Database uses a special value JSON NULL, which represents a value of JSON type NULL. JSON NULL may occur as a value of a field of data type Json or one of its sub-fields that has a value null. JSON NULL value is different and separate from SQL NULL. For example, if table MyTable has a field info of type JSON, a query such as SELECT info.name from MyTable will yield different results for records where the value of info.name is null (e.g. if the value of info is { "name": null }) with the result being JSON NULL and for records where the value of the info field itself is NULL (SQL NULL), with result being a SQL NULL. In addition, the info field itself may take values of SQL NULL or JSON NULL which are distinct values, the latter being a value of a JSON type NULL (i.e.the value of info is JSON value null). For more details, please see the Oracle NoSQL Database SQL Reference Guide.
The only value of this class is JsonNull, which is the only immutable singleton instance of this class. No other values are instantiated.
On output, JSON NULL values returned by the driver will always be JsonNull. On input, when using MapValue to create a value for a JSON field, it is acceptable to use either JsonNull or Null as value of the sub-field inside the MapValue. However, JsonNull and Null will be treated as different values (JSON NULL and SQL NULL) if used as a value for the whole JSON field as described above.
Examples
Instantiating the row value with fields id and info where info is field of data type Json and has value of { "name": null }.var row = new MapValue
{
["id"] = 1000,
["info"] = new MapValue
{
["name"] = FieldValue.JsonNull
}
};
Properties
Name | Description |
---|---|
DbType | Gets DbType of this instance which represents the type of this value. |
Methods
Name | Description |
---|---|
SerializeAsJson(Utf8JsonWriter, JsonOutputOptions) | Writes JSON representation of the value to the stream represented by Utf8JsonWriter. |