Database Reference
In-Depth Information
cqlsh:weblog> INSERT INTO comments (id, post_id, commenter,
title, content, posted_on) VALUES (now(),
c06a42f0-22b2-11e4-a4f0-7f1a8b30f852, 'tom@gmail.com',
'Nice!', 'Thanks, this is good stuff.', 1407868975000);
cqlsh:weblog> INSERT INTO comments (id, post_id, commenter,
title, content, posted_on) VALUES (now(),
c06a42f0-22b2-11e4-a4f0-7f1a8b30f852, 'g@ouv.com', 'Follow
my blog', 'Please follow my blog.', 1407868979000);
cqlsh:weblog> INSERT INTO comments (id, post_id, commenter,
title, content, posted_on) VALUES (now(),
047224f0-22b2-11e4-a4f0-7f1a8b30f852, 'liz@gmail.com', 'New
blogger?', 'Welcome to weblog application.', 1407868981000);
# Insert some votes
cqlsh:weblog> UPDATE comment_votes SET upvotes = upvotes +
1 WHERE comment_id = be127d00-22c2-11e4-a4f0-7f1a8b30f852;
cqlsh:weblog> UPDATE comment_votes SET upvotes = upvotes +
1 WHERE comment_id = be127d00-22c2-11e4-a4f0-7f1a8b30f852;
cqlsh:weblog> UPDATE comment_votes SET downvotes =
downvotes + 1 WHERE comment_id =
be127d00-22c2-11e4-a4f0-7f1a8b30f852;
cqlsh:weblog> UPDATE post_votes SET downvotes = downvotes +
1 WHERE post_id = d44e0440-22c2-11e4-a4f0-7f1a8b30f852;
cqlsh:weblog> UPDATE post_votes SET upvotes = upvotes + 1
WHERE post_id = d44e0440-22c2-11e4-a4f0-7f1a8b30f852;
Counters are always inserted or updated using the UPDATE statement.
Search WWH ::




Custom Search