在mongodb中,我们可以将嵌入的文档存储到一个集合中。然后,我们如何将嵌入的文档存储到cassandra中?对于此示例JSON表示???
UserProfile = {
name: "user profile",
Dave Jones: {
email: {name: "email", value: "dave@email.com", timestamp: 125555555},
userName: {name: "userName", value: "Dave", timestamp: 125555555}
},
Paul Simon: {
email: {name: "email", value: "paul@email.com", timestamp: 125555555},
phone: {name: "phone", value: "4155551212", timestamp: 125555555},
userName: {name: "userName", value: "Paul", timestamp: 125555555}
}
}
答案 0 :(得分:0)
如果您的文档嵌套级别不是太深,可以使用C * 2.1中的User Defined Types。
我个人建议将您的架构重新考虑为更扁平的形式,如:
create table profiles (
name text,
name2 text,
email text,
username text,
ts timestamp,
primary key (name,name2) // compound primary key!
)