Option objname
The objname option associates records using one of the fields as keys.
With the columns option, the field is identified by its column name. It must be a string or a buffer. Without the column option, the field is identified by its index position. It must be a number.
- Type:
string|Buffer|number - Optional
- Default:
undefined - Since: early days
- Related:
column,info,raw— see Available Options
The option is compatible with the raw and info options.
As a column name
Field names reference one of the record property. Thus, they require the usage of the column option to generate records as object literal instead of array.
Below, the objname option is a string and it defines the c2 column:
As an index name
Index names reference a record field by its position. Thus, records must be generated as arrays.
Below, the objname option is a number and it defined the field in the second postion at index 1: