Get Op

This op represents a retrieval operation

This operation returns one specific value, referenced by a key from the resulting expression or a default if specified.

Definition:["get", <key: string, expression(string)>, <result: expression(array)> [, <default: expression(any)>]]

For example for an array:

[
  'path' => [
     'to' => [
        'value' => 'this is a value'
     ]
  ]
]

You can return 'this is a value' directly if you use the key path.to.value. If the key does not exist in resulting array in <result: expression(array)>, NULL will be returned unless there is a default expression specified.

You can also specify an expression to be evaluated as a key which must return a string.

Usage

Request:

["get", "path.to.value", ["value", {
    "path" : {
        "to" : {
           "value" : "this is a value"
        }
    }
}]]

Response:

"this is a value"

Typical Usage

You would use this operation to return a specific desired result directly from a processed expression.