On Mon, Nov 17, 2014 at 10:52 PM, Kevin Burton <bur...@spinn3r.com> wrote:
> There’s still a lot of weirdness in CQL. > > For example, you can do an INSERT with an UPDATE .. .which I’m generally > fine with. Kind of make sense. > > However, with INSERT you can do IF NOT EXISTS. > > … but you can’t do the same thing on UPDATE. > > So I foolishly wrote all my code assuming that INSERT/UPDATE were > orthogonal, but now they’re not. > > you can still do IF on UPDATE though… but it’s not possible to do IF > mycolumn IS NULL > > .. so is there a way to mimic IF NOT EXISTS on UPDATE or is this just a > bug? > There is no way to mimic IF NOT EXISTS on UPDATE and it's not a bug. INSERT and UPDATE are not totally orthogonal in CQL and you should use INSERT for actual insertion and UPDATE for updates (granted, the database will not reject our query if you break this rule but it's nonetheless the way it's intended to be used). -- Sylvain > > -- > > Founder/CEO Spinn3r.com > Location: *San Francisco, CA* > blog: http://burtonator.wordpress.com > … or check out my Google+ profile > <https://plus.google.com/102718274791889610666/posts> > <http://spinn3r.com> > >