简体   繁体   中英

how to check if a value is modified from the last time (UPDATE -INSERT) in Cassandra

if UPDATE USING Timestamp is the answer, then how does it work? How can I get the current timestamp value to know if has been modified or not?

You can use writetime() function to get timestamp of when a cell was written.

INSERT INTO excelsior.clicks (userid, url, date, name)
  VALUES (
    cfd66ccc-d857-4e90-b1e5-df98a3d40cd6,
    'http://google.com',
    '2013-10-11', 'Bob'
);

SELECT url, date, name, WRITETIME(name) FROM excelsior.clicks
  WHERE userid = cfd66ccc-d857-4e90-b1e5-df98a3d40cd6;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM