Deserialize the result of a json-path.
Deserialize the result of a json-path. The input should be pointing to the start of
the bytes written by serialize
. There is no guarantee where the input will be
pointing after completion.
If the path selects leaf elements, they will be returned as primitives. If the path selects objects, they will be returned as json strings. If more than one item is selected, they will be returned in a Seq. If nothing is selected, it will return null.
input, pointing to the start of the json object
json path to evaluate
result of the path, if any
Deserialize the given input.
Deserialize the given input. The input should be pointing to the start of
the bytes written by serialize
. Upon completion, the input will be pointing
to the first byte after the bytes written by serialize
.
input, pointing to the start of the json object
parsed json object
Deserialize the given input.
Deserialize the given input. The input should be pointing to the start of
the bytes written by serialize
. Upon completion, the input will be pointing
to the first byte after the bytes written by serialize
.
input, pointing to the start of the json object
json as a string
Serialize a json object
Serialize a json object
output to write to
object to serialize
Serialize a json object
Serialize a json object
output to write to
json string to serialize - must be a json object
Serializes into bson (http://bsonspec.org/). Note this is a limited form of bson that only matches the existing json types - does not cover the bson extensions like binary data, etc. Also note endianness, etc might not match the spec 100%.
Reduced BSON spec - only native JSON elements supported:
byte 1 byte (8-bits) int32 4 bytes (32-bit signed integer, two's complement) int64 8 bytes (64-bit signed integer, two's complement) double 8 bytes (64-bit IEEE 754-2008 binary floating point)
document ::= int32 e_list "\x00" BSON Document. int32 is the total number of bytes comprising the document. e_list ::= element e_list | "" element ::= "\x01" e_name double 64-bit binary floating point | "\x02" e_name string UTF-8 string | "\x03" e_name document Embedded document | "\x04" e_name document Array | "\x08" e_name "\x00" Boolean "false" | "\x08" e_name "\x01" Boolean "true" | "\x09" e_name int64 UTC datetime | "\x0A" e_name Null value | "\x10" e_name int32 32-bit integer | "\x11" e_name int64 Timestamp | "\x12" e_name int64 64-bit integer e_name ::= cstring Key name string ::= int32 (byte*) "\x00" String - The int32 is the number bytes in the (byte*) + 1 (for the trailing '\x00'). The (byte*) is zero or more UTF-8 encoded characters. cstring ::= (byte*) "\x00" Zero or more modified UTF-8 encoded characters followed by '\x00'. The (byte*) MUST NOT contain '\x00', hence it is not full UTF-8.
Note: Array - The document for an array is a normal BSON document with integer values for the keys, starting with 0 and continuing sequentially. For example, the array ['red', 'blue'] would be encoded as the document {'0': 'red', '1': 'blue'}. The keys must be in ascending numerical order.