loopbackio / loopback-connector-cassandra

Cassandra connector for the LoopBack framework.
Other
13 stars 22 forks source link

Creating Arrays? #93

Closed gtamas closed 3 years ago

gtamas commented 3 years ago

Suggestion

Use Cases

I wanna store an array of strings.

Examples

I tried to use this in Loopback 4, but all I get in Cassandra is a simple text field:

  @property.array(String, {
    default: [],
    jsonSchema: {
      uniqueItems: true,
      type: 'string',
      format: 'uri-reference',
      errorMessage: 'An array of file URLs is expected',
    },
  })
  attachments?: string[];

How to create an array?

Acceptance criteria

TBD - will be filled by the team.

gtamas commented 3 years ago

Solved elsewhere.

Turns out you need to use cassandra sepcific config:

  cassandra: {
      dataType: 'List<Text>'
    },