Cassandra update column

帅比萌擦擦* 提交于 2019-12-20 03:17:04

问题


how can i update column in cassandra database??

columnfam{
  username{
    name:edds,
    surname:surname,
    email:mymail@rrr.com
  }
}

for example i need update surname??

im using php client PHPCASSA.

thanx


回答1:


As Octopus-Paul says, updates are the same as inserts. There's no need to read before writing, though. You can just do this:

$column_family->insert('username', array('surname' => $new_surname));



回答2:


Have a look here cassandra-internals-writing (Look at comments 14 and 15). I guess that if you retrieve data from your database, modify your data in PHP and reinsert that that back it will get updated (if your data has an UUID it will be updated - This is just an assumption -but give it a try)



来源:https://stackoverflow.com/questions/4699052/cassandra-update-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!