【问题标题】:Replace with update in cassandra替换为 cassandra 中的更新
【发布时间】:2021-11-02 21:34:11
【问题描述】:

我想用方法替换将字符串更新为另一个字符串。 我已经用 MYSQL 更新成功,但是 cassandra,我有一个错误。 谢谢大家!

This is commandline with MySQL:
    update table_1
    set field_1 = replace(field_1, 'hello', 'bonjour') where user_id = 9999;

【问题讨论】:

    标签: node.js replace command-line cassandra table-plus


    【解决方案1】:

    @LiamNguyen,您可以在 Cassandra 中按如下方式实现:

    UPDATE table_1
      SET field_1 = `bonjour`
    WHERE user_id = 9999
      IF field_1 = 'hello';
    

    其他参考资料:

    p/s:我假设 user_id 是您的 Cassandra 表的主键

    【讨论】:

    • 非常感谢您的帮助!
    猜你喜欢
    • 1970-01-01
    • 2016-10-07
    • 2022-01-15
    • 2017-12-02
    • 2017-09-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多