Object

Object transforms operate on JSON objects.

object.copy

Copies values into, from, and between JSON keys.

Settings

FieldTypeDescriptionRequired
object.source_keystringRetrieves a value from an object for transformation.No
object.target_keystringPlaces a value into an object after transformation.No

Example

sub.transform.object.copy(
  settings={object: {source_key: 'a', target_key: 'z'}}
)
sub.tf.obj.cp({obj: {src: 'a', trg: 'z'}})

object.delete

Deletes a key from a JSON object.

Settings

FieldTypeDescriptionRequired
object.source_keystringKey that is deleted from the object.Ye

Example

sub.transform.object.delete(
  settings={object: {source_key: 'a'}}
)
sub.tf.obj.del({obj: {src: 'a'}})

object.insert

Inserts a static value into a JSON object.

Settings

FieldTypeDescriptionRequired
object.target_keystringPlaces a value into an object after transformation.Yes
valueanyValue set into the object.Yes

Example

sub.transform.object.insert(
  settings={object: {target_key: 'x'}, value: 'abc'}
)
sub.tf.obj.insert({obj: {trg: 'x'}, value: 'abc'})

object.jq

Applies a JQ filter to a JSON object.

Settings

FieldTypeDescriptionRequired
filterstringjq filter applied to the object.Yes

object.to.boolean

Converts a JSON value to a boolean.

Settings

FieldTypeDescriptionRequired
object.source_keystringRetrieves a value from an object for transformation.No
object.target_keystringPlaces a value into an object after transformation.No

Example

sub.transform.object.to.boolean(
  settings={object: {source_key: 'a', target_key: 'z'}}
)
sub.tf.obj.to.bool({obj: {src: 'a', trg: 'z'}})

object.to.float

Converts a JSON value to a float.

Settings

FieldTypeDescriptionRequired
object.source_keystringRetrieves a value from an object for transformation.No
object.target_keystringPlaces a value into an object after transformation.No

Example

sub.transform.object.to.float(
  settings={object: {source_key: 'a', target_key: 'z'}}
)
sub.tf.obj.to.float({obj: {src: 'a', trg: 'z'}})

object.to.integer

Converts a JSON value to an integer.

Settings

FieldTypeDescriptionRequired
object.source_keystringRetrieves a value from an object for transformation.No
object.target_keystringPlaces a value into an object after transformation.No

Example

sub.transform.object.to.integer(
  settings={object: {source_key: 'a', target_key: 'z'}}
)
sub.tf.obj.to.int({obj: {src: 'a', trg: 'z'}})

object.to.string

Converts a JSON value to a string.

Settings

FieldTypeDescriptionRequired
object.source_keystringRetrieves a value from an object for transformation.No
object.target_keystringPlaces a value into an object after transformation.No

Example

sub.transform.object.to.string(
  settings={object: {source_key: 'a', target_key: 'z'}}
)
sub.tf.obj.to.str({obj: {src: 'a', trg: 'z'}})

object.to.unsigned_integer

Converts a JSON value to an unsigned integer.

Settings

FieldTypeDescriptionRequired
object.source_keystringRetrieves a value from an object for transformation.No
object.target_keystringPlaces a value into an object after transformation.No

Example

sub.transform.object.to.unsigned_integer(
  settings={object: {source_key: 'a', target_key: 'z'}}
)
sub.tf.obj.to.uint({obj: {src: 'a', trg: 'z'}})

Use Cases

Convert Data To an Object

Convert data into a JSON object by configuring the object.set_key:

sub.transform.object.copy(
  settings={object: {target_key: 'z'}}
)
abc
{"z":"abc"}

Convert Data From an Object

Convert a JSON value into data by configuring the object.key:

sub.transform.object.copy(
  settings={object: {source_key: 'z'}}
)
{"z":"abc"}
abc