【发布时间】:2019-08-04 13:12:03
【问题描述】:
我正在尝试插入一些共享行 ID 的行,并决定坚持使用基于时间的 uuid。我能找到的所有文档都解释了如何创建这样的一行:
INSERT INTO users (id, name) VALUES (now(), 'Florian')
我正在使用DataStax's cassandra-driver for Node.js 来执行我的查询(其中insertUser 是一个包含上述查询的字符串):
var r = await client.execute(insertUser)
console.dir(r.rows)
结果如下:
ResultSet {
info:
{ queriedHost: '127.0.0.1:9042',
triedHosts: { '127.0.0.1:9042': null },
speculativeExecutions: 0,
achievedConsistency: 10,
traceId: undefined,
warnings: undefined,
customPayload: undefined,
isSchemaInAgreement: true },
rows: undefined,
rowLength: undefined,
columns: null,
pageState: null,
nextPage: undefined }
正如我们所见,结果中没有可用于创建相关行的 id。
是否有一种 Cassandra 惯用的方式来根据相同的 id 创建多行而不生成本地 id?
【问题讨论】:
标签: node.js cassandra row cql3