Retrieving status updates for a specific time range

Having explored the limits of the WHERE keyword in CQL, let's return to the user_status_updates table. Suppose we'd like to build an archive feature for MyStatus that displays all of the user's status updates for a requested month. In CQL terms, we want to select a range of clustering columns; for instance, let's get back all of alice's status updates created in May 2014:

SELECT "id", DATEOF("id"), "body"FROM "user_status_updates"WHERE "username" = 'alice'AND "id" >= MINTIMEUUID('2014-05-01')AND "id" <= MAXTIMEUUID('2014-05-31');

Before diving into the mechanics of this query, we can confirm that the only status update is the one with a UUID that was provided in the previous chapter, and ...

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.