problem updating/inserting a set<text>

29 views
Skip to first unread message

acr...@gmail.com

unread,
Mar 16, 2014, 12:48:34 PM3/16/14
to hel...@googlegroups.com
Hi,

I'am trying to update/insert a set<text> buy having some troubles.

It's set<> columntype supported?

THIS DOES NOT WORK:

Pool.cql("UPDATE match_details SET items=? WHERE match_id=? AND account_id=? AND hero_id=?",
[
['it1','it2', 'it3'],
99999,
66666,
33333,
],
function(err, res){
});

Exception:

{ [HelenusInvalidRequestException: line 1:43 no viable alternative at input 'it3'] name: 'HelenusInvalidRequestException' }


THIS WORKS FINE:

Pool.cql("UPDATE match_details SET items=['it1','it2', 'it3'] WHERE match_id=? AND account_id=? AND hero_id=?",
[
99999,
66666,
33333,
],
function(err, res){
});


Thanks for your help

Russell Bradberry

unread,
Apr 30, 2014, 5:13:15 PM4/30/14
to hel...@googlegroups.com, acr...@gmail.com
since there is a difference between how SETs wotk and LISTs work in CQL, and there is no SET type in javascript, the proper way to update should be 

UPDATE foo SET myset = {?}

for a SET and for a LIST:

UPDATE foo SET mylist = [?]
Reply all
Reply to author
Forward
0 new messages