I am try to insert a record into cassandra-2.2.3 using datastax Node.js driver ([email protected]). Most of the cql operations work well, however below cql statement can't execute correctly. The driver continues respond "Cannot provide custom timestamp for conditional updates"?
var current = new Date();
var current_timestamp = current.getTime();
var userId = uuid.random();
var cqlStatement = "INSERT INTO user_credentials(email, password, userid) VALUES(?, ?, ?) IF NOT EXISTS USING TIMESTAMP ?";
var cqlParams = [user.emailAddress, user.password, userId, current_timestamp];
cassandra_client.execute(cqlStatment, cqlParams, { prepare: true }, function (err, result) {
if (err) {
var exception = new ttypes.UserManagementException()
exception.code = ttypes.UserManagementErrorCode.INTERNAL_ERROR;
exception.reason = err.reason;
callback(err); //tell client exception occurred
return;
}
console.log("Execute correctly");}
Any one has encounter similar issue? Or any advise?