简体   繁体   English

如何检查是否在Cassandra中从上次修改值(UPDATE -INSERT)

[英]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? if UPDATE USING Timestamp是答案,那么它如何工作? 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. 您可以使用writetime()函数获取写入单元格的时间戳。

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;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Cassandra 上的交易“检查并插入” - Transaction `Check and Insert` on Cassandra 从Cassandra获取当前值-更新使用时间戳? - Get the current value FROM Cassandra - Update USING TIMESTAMP? 如何在Cassandra中以独特和原子的方式实现跨多个表的插入? - How to achieve an insert across multiple tables in Cassandra, uniquely and atomically? 如何回滚通过单个 api 调用的不同 function 调用在不同表中完成的所有插入和更新 - How to rollback all the insert and update that are done in different tables from different function calls that are called through the single api 如何使用 DAO 检测 Yii 中事务中的最后插入 ID? - How to detect the last insert ID within a transaction in Yii using DAO? PHP / MYSQL如何在事务中获取last_insert_id - PHP/MYSQL how to get last_insert_id in transaction 如何在 elasticsearch 更新前检查属性? - How to check properties before update in elasticsearch? 如何避免数据覆盖(丢失)写入-Cassandra中的多线程在同一对象上更新 - how to avoid data overwrite (lost) write - update on same object by multiple thread in Cassandra 按时间事务表排序的 Cassandra 分页 - Cassandra paging in ordered by time transactions table 如何全面拦截 Hibernate 4 应用程序中的插入/更新/删除数据库事务 - How to comprehensively intercept Insert/Update/Delete DB Transactions in a Hibernate 4 application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM