Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version next

...

  • A single field value of an Object data type must have unique keys. Values may, however, be repeated.
  • The order of key-value pairs is not guaranteed.
  • For more information, see Object Data Type.

 

D s

D s
snippetBasic

Object literal reference example:

FILTEROBJECT
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
filterobject('{"q":"hello","r","there":"q","world"}', 'q') as:'q'

filterobject('{"q":"hello","r","there":"q","world"}', 'q')

Output: Generates a new q column containing  Returns an Object of key-value pairs for the q key:

...

Column reference example:

FILTEROBJECT
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
filterobject(myObjects, '[k1,k2]') as:'k-values'

filterobject(myObjects, '[k1,k2]')

Output:

...

 Returns an Object of key-value pairs for all instances of the k1 and k2 keys.

D s
snippetSyntax

FILTEROBJECT
d-code-lang-syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value:
filterobject(obj,'keys')

filterobject(obj,'keys')


ArgumentRequired?Data TypeDescription
obj_colYString or ObjectName of column, function returning an Object, or Object literal to be filtered
keysYArrayArray representing the keys to filter. Each element can be a String, function returning a String, or a reference to a column of String values.

...