loopback icon indicating copy to clipboard operation
loopback copied to clipboard

Cassandra UDT not being persisted in cassandra database

Open nishankpathak opened this issue 3 years ago • 1 comments

Hi @hilagut @fabien @Schoonology , Loopack team, The code is converting Json object string. We debugged and found the issue with Cassandra.prototype.create function in loopback-connector-cassandra/lib/cassandra.js. Please provide the solution for the issue.

model class import {Entity, model, property} from '@loopback/repository'; @model() export class Address { @property({ type: 'string' }) street: string;

@property({ type: 'string' }) city: string;

@property({ type: 'string' }) state_or_province: string;

@property({ type: 'string' }) postal_code: string;

@property({ type: 'string' }) country: string; } @model({name: 'hotels'}) export class Hotels extends Entity { @property({ type: 'string', id: true, }) id?: string;

@property({ type: 'string', required: true, }) name: string;

@property({ type: 'string', required: true, }) phone: string;

@property({ type: 'Object', required: true }) address: Address;

@property({ type: 'array', itemType: 'string' }) pois: string[];

// Define well-known properties here

// Indexer property to allow additional data // eslint-disable-next-line @typescript-eslint/no-explicit-any [prop: string]: any;

constructor(data?: Partial<Hotels>) { super(data); } }

export interface HotelsRelations { // describe navigational properties here }

export type HotelsWithRelations = Hotels & HotelsRelations;

nishankpathak avatar Feb 16 '22 14:02 nishankpathak

Hi @nishankpathak, this repository is for LoopBack 3. Please create an issue or GitHub Discussion in https://github.com/loopbackio/loopback-next for LoopBack 4-related matters.

achrinza avatar Feb 18 '22 17:02 achrinza