c# - 尝试使用 C# 中的 Guid 作为 Cassandra 中的主键

标签 c# cassandra nosql datastax cassandra-3.0

我目前正在处理我的 NoSQL 项目,我有两个数据库 Cassandra 和 Redis(我使用 Redis 进行缓存)。现在使用 Redis 我有一个列表,我使用 DataContract 序列化我的自定义对象,但是当谈到 Cassandra 时,我很挣扎,因为我试图以某种方式在 Cassandra 表中插入 Guid,我在其中使用 uuid 作为主键。我在网上搜索了一下,只能找到Guid是Cassandra的uuid类型的数据。我在 Cassandra 中使用 now() 插入了 uuid,所以我想知道我是否可以以某种方式从 C# 调用 now() 或者我是否可以以某种方式将 Guid 转换为 uuid。非常感谢任何帮助或引用。谢谢。

最佳答案

根据 driver documentation , uuid 已经映射到 Guid 并返回...所以你可以简单地 bind your variable into corresponding placeholder in statement .

关于c# - 尝试使用 C# 中的 Guid 作为 Cassandra 中的主键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48328660/

相关文章:

elasticsearch - 如何将Elastic search与cassandra集成?

scala - 使用 Scala 读取 Cassandra 中的并行性

python - 为什么我的代码的结果出乎意料?

C#解析字符串拆分

c# - [机器人框架] : How to fix:Welcome message is not getting displayed to the user in C# WebChatBot developed in V4 but displayed in Emulator?

java - Cassandra 击落主机重试 (Hector)

nosql - Cassandra CLI 'org.apache.thrift.transport.TTransportException'

c# - 禁用 Windows 窗体 Web 浏览器中的提示

c# - 使用矩阵放大固定点

java - 在 mongodb 中检索下 N 条记录