Getting value from Key type TimeUUID in Cassandra-PHP

I am new to cassandra and I want to get values ​​from a column family where the key is TimeUUIDType.

I use PHP with PHPCassa, and I can correctly insert (install) into the column family by creating uuid with the function:

$key = CassandraUtil::uuid1(); 

The problem arises when I try to get in the column family, because I have uuid in String format (something like this):

 $uuidString= "e2658820-69f2-11e1-af9a-95dd4f324d9"; 

I would like to know if it is possible to apply or convert a String form to a valid uuid for cassandra in php or phpcassa, because my goal is on another page, creating the correct uuid from $ uuuidString.

Thanks.

+4
source share
1 answer

CassandraUtil::import($uuidString) will handle this.

Edit Starting with phpcassa 1.0+, \phpcassa\UUID::import() is the correct method.

+2
source

Source: https://habr.com/ru/post/1400622/


All Articles