doushenyu8228 2017-04-25 10:22
浏览 58
已采纳

Cassandra PHP - 检查给定的timeuuid字符串是否是有效的timeuuid

How can I check if a given timeuuid i.e. fa6e9e80-299c-11e7-98d8-f7a8744353f3 is a valid timeuuid before query?

using a slighty different, yet still right format timeuuid: fa6e9e80-299c-11e7-98d8-f7a8744353av results in an error:

object(Cassandra\Exception\InvalidSyntaxException)#199 (7) { ["message":protected]=> string(54) "line 1:103 mismatched character 'v' expecting set null"

Cassandra PHP driver documentation does not seem to offer a valid function to check. ( https://datastax.github.io/php-driver/api/Cassandra/ )

  • 写回答

1条回答 默认 最新

  • douxiaomang5640 2017-04-25 10:41
    关注

    Check the version of the uuid using version() method. if 1 then it's timeuuid.

    https://datastax.github.io/php-driver/api/Cassandra/interface.UuidInterface/#method-version

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 我这模型写的不对吗?为什么lingo解出来的下面影子价格这一溜少一个变量
  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波