Mapper - type coercion

8 views
Skip to first unread message

Yarden Bar

unread,
May 4, 2020, 10:29:42 AM5/4/20
to DataStax Node.js Driver for Apache Cassandra Mailing List
Hi,
Is there a way to specify column type conversion in the mapper?
For example, say MyObject has a SpecialType member:
interface MyObject {
  id: number,
  name: string,
  specialType: SpecialType // SpecialType might be a class/interface
}

In the above case, I'd like to be able to tell the mappert to JSON.stringify(specialType) on insert/update and JSON.parse(specialType) in get/findAll

Appreciate opinions

Jorge Bay Gondra

unread,
May 4, 2020, 11:51:50 AM5/4/20
to DataStax Node.js Driver for Apache Cassandra Mailing List
Hi,
Type conversion is not currently supported.

Thanks,
Jorge

Yarden Bar

unread,
May 4, 2020, 1:47:23 PM5/4/20
to DataStax Node.js Driver for Apache Cassandra Mailing List
GTN
Reply all
Reply to author
Forward
0 new messages