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 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用