node-cassandra-cql icon indicating copy to clipboard operation
node-cassandra-cql copied to clipboard

string with hyphens

Open NiveditaViswanath opened this issue 11 years ago • 1 comments

I was trying to insert into a table with an 'id' column that is of 'text' datatype. The value I was trying to insert is : "115f1999-b4e4-4e0d-9f81-47cd5e6b2801"

I get a 'String didn't validate' error.

This error is not from Cassandra's side, since I am able to manually insert this value. What is the workaround for this?

'

NiveditaViswanath avatar Oct 09 '14 19:10 NiveditaViswanath

Have you tried using hint syntax? I suspect that node-cassandra-cql is detecting that your string is a UUID, and hence sending it a CQL statement without quotes.

https://github.com/jorgebay/node-cassandra-cql#how-can-specify-the-target-data-type-of-a-query-parameter

Also, don't forget to migrate to the new version of the driver:

https://github.com/datastax/nodejs-driver

srlm-io avatar Oct 09 '14 19:10 srlm-io