Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,我如何按列的时间戳对我的条目进行排序?
def self.get_users @@db.execute("SELECT * FROM users") end
你的意思是值的时间戳,还是你的列键是某种时间戳?
CQL 不支持排序 - 它按照存储在磁盘上的顺序返回数据。您可以通过在列族上指定比较器类型来告诉 Cassandra 您希望列如何排序。在这种情况下,您可以考虑使用 [timestamp, column name] 的复合列键。