[Announcement] DataStax Node.js Driver v4.6.0 Released

34 views
Skip to first unread message

Jorge Bay Gondra

unread,
Aug 11, 2020, 8:40:08 AM8/11/20
to nodejs-dr...@lists.datastax.com
Hi,
I'm happy to announce the release of version 4.6.0 of the DataStax Node.js Driver for Apache Cassandra, that features support for type conversions in the Mapper along with other improvements and bug fixes.

Thanks to this new feature, you can now define type conversion from your model to your database type.

For example, consider the following mappings:

const mappingOptions = {
  models: {
    'User': {
      tables: ['users'],
      mappings: new UnderscoreCqlToCamelCaseMappings(),
      columns: {
        'info': {
          fromModel: JSON.stringify,
          toModel: JSON.parse
        }
      }
    }
  }
};


The Mapper will convert the data in the "info" column and represent it as a JavaScript object, and the other way around, for example, you can provide the value of the property as an Object.

await userMapper.insert({ userId, info: { birthdate, favoriteBrowser } });

You can visit the Mapper documentation section for Defining Mappings for more information and. The complete list of new improvements and bug fixes is in the changelog.

The new version is available on the npm registry.

Thanks,
Jorge

Yarden Bar

unread,
Aug 11, 2020, 10:25:28 AM8/11/20
to DataStax Node.js Driver for Apache Cassandra Mailing List
This is massive! Thank you
Reply all
Reply to author
Forward
0 new messages