Represents the syntax for defining a set column in a table, which has no shorthand/"loose" equivalent.
set
Of the example format:
columns: { setCol: { type: 'set', valueType: 'text' },} Copy
columns: { setCol: { type: 'set', valueType: 'text' },}
This may then be used through astra-db-ts as n Set<ValueType>:
astra-db-ts
Set<ValueType>
await table.insertOne({ setCol: new Set(['value1', 'value2', 'value3']),}); Copy
await table.insertOne({ setCol: new Set(['value1', 'value2', 'value3']),});
The valueType may be any scalar type, such as 'int', 'text', or 'uuid'.
valueType
'int'
'text'
'uuid'
Nested collection types are not supported.
import { uuid } from '@datastax/astra-db-ts';await table.insertOne({ setCol: new Set([uuid(4), uuid(4), uuid(7)]),}); Copy
import { uuid } from '@datastax/astra-db-ts';await table.insertOne({ setCol: new Set([uuid(4), uuid(4), uuid(7)]),});
Overview
Represents the syntax for defining a
set
column in a table, which has no shorthand/"loose" equivalent.Of the example format:
This may then be used through
astra-db-ts
as nSet<ValueType>
:The value type
The
valueType
may be any scalar type, such as'int'
,'text'
, or'uuid'
.Nested collection types are not supported.
Example