Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict";
const cassandra = require('cassandra-driver');
const Uuid = cassandra.types.Uuid;
const UnderscoreCqlToCamelCaseMappings = cassandra.mapping.UnderscoreCqlToCamelCaseMappings;
const client = new cassandra.Client({ contactPoints: ['127.0.0.1'], localDataCenter: 'datacenter1' });
const mapper = new cassandra.mapping.Mapper(client, { models: {
'Video': {
tables: ['videos', 'user_videos', 'latest_videos'],
keyspace: 'examples',
columns: {
'videoid': 'videoId',
'userid': 'userId'
},
mappings: new UnderscoreCqlToCamelCaseMappings()
}
}});
const videoId = Uuid.random();
const userId = Uuid.random();
/**
* Inserts an object and retrieves it using the Mapper.
"use strict";
const cassandra = require('cassandra-driver');
const Uuid = cassandra.types.Uuid;
const UnderscoreCqlToCamelCaseMappings = cassandra.mapping.UnderscoreCqlToCamelCaseMappings;
const client = new cassandra.Client({ contactPoints: ['127.0.0.1'], localDataCenter: 'datacenter1' });
const mapper = new cassandra.mapping.Mapper(client, { models: {
'Video': {
tables: ['videos', 'user_videos', 'latest_videos'],
keyspace: 'examples',
columns: {
'videoid': 'videoId',
'userid': 'userId'
},
mappings: new UnderscoreCqlToCamelCaseMappings()
}
}});
const videoId = Uuid.random();