How to Filter by DateTime in Cassandra

#1

I have a type that is saved in Cassandra, it is defined as below

@db(compactType=true,
datastore=‘cassandra’,
partitionKeyField=‘parent’,
persistenceOrder=‘timestamp’,
persistDuplicates=false,
shortId=true,
shortIdReservationRange=100000)
entity type CassandraType schema name ‘CT’ {
parent: Some_Other_Type
timestamp: datetime
}

When I do fetch with
CassandraType.fetch({filter: “parent.id == ‘an Id’ && timestamp > ‘2017-09-01’”})

I don’t get any result.

What’s the correct syntax to filter by datetime?

1 Like

#2

CassandraType.fetch({filter: “parent.id == ‘an Id’ && timestamp > dateTime(‘2017-09-01’)”})

1 Like