jorgebay / node-cassandra-cql

Node.js driver for Apache Cassandra
MIT License
144 stars 42 forks source link

string with hyphens #112

Open NiveditaViswanath opened 10 years ago

NiveditaViswanath commented 10 years ago

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?

'

srlm-io commented 10 years ago

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