using UUID1 with phpcassa

心不动则不痛 提交于 2019-12-06 07:46:34

$uuid1 is not string, but an object. When we do

$cf->insert("$key"  , array($uuid1 => $url) );

the object is converted to string, and insert fails. phpcassa does not give exeption, but insert fails anyway.

Seems like we need to use ARRAY_FORMAT, so the object not to be "flatten" to string,

$uuid1 = phpcassa\UUID::uuid1(null, $time);

$cf->insert_format = phpcassa\ColumnFamily::ARRAY_FORMAT;

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