The strict field definition is the more structured way to define a field, and follows the following example form:
fields: { id: { type: 'uuid' }, tags: { type: 'set', valueType: 'text' }, metadata: { type: 'map', keyType: 'text', valueType: 'int' },} Copy
fields: { id: { type: 'uuid' }, tags: { type: 'set', valueType: 'text' }, metadata: { type: 'map', keyType: 'text', valueType: 'int' },}
In this form, the key is the field name, and the value is an object with a type field that specifies the type of the field.
type
The object may also contain additional fields that are specific to the type of the field:
map
keyType
valueType
'text'
'ascii'
list
set
If you're simply defining a scalar field, you can use the shorthand "loose" syntax instead, which is equivalent to the above for id:
id
fields: { id: 'uuid',} Copy
fields: { id: 'uuid',}
Overview
The strict field definition is the more structured way to define a field, and follows the following example form:
In this form, the key is the field name, and the value is an object with a
typefield that specifies the type of the field.The object may also contain additional fields that are specific to the type of the field:
map, you must specify thekeyTypeandvalueTypefields.keyTypemust, for the time being, be either'text'or'ascii'.valueTypemust be a scalar type.lists andsets, you must specify thevalueTypefield.valueTypemust be a scalar type.The "loose" shorthand syntax
If you're simply defining a scalar field, you can use the shorthand "loose" syntax instead, which is equivalent to the above for
id: