Is there a way to query by last-update-time (LUT)?

I want to get all the records which have been updated after a specific time. Will I have to maintain a bin ‘last_updated’? Or is there a way to utilise last-update-time from metadata?

Very soon :slight_smile: . I believe it will appear in the next release.

And when is the next release due?

Major releases come out roughly every quarter, see release notes. So the next major release should be in April.

@kporter I believe this feature is released now? How do I use the last-update-time while querying?

The solution is to use predicate filtering, an example using last update time can be found here:

https://github.com/aerospike/aerospike-client-java/blob/master/examples/src/com/aerospike/examples/QueryPredExp.java#L175-L187

@kporter Thanks. Is there an equivalent term for aql? (I checked aql - Querying records docs, but it isn’t clear.)

EDIT: Or in Python? I couldn’t find docs for that too. :confused:

AQL doesn’t have that ability right now. It’s a tool for (sort of) browsing data and administration of indexes, UDF registration, users/roles. It’s not intended for you to write applications with - that’s what those language clients are for.

Yes, I understand. This is not really for writing an application.

I want to check how much of “old” data we have in a particular set, so we can decide the appropriate archival/deletion strategy.

If not AQL, I can work with the Python client too. Could you please point me to the “query by LUT” docs for python? I’m unable to find it for Python.

Aerospike Team,

Do we have any update on this? Even I’m in need of this.

Python and aql still do not support predicate filters. I know Java and C support this feature.

@jan, @khosrow, what is the status for other clients?

Go does support predicate filters.

Check out the Client Feature Matrix: Currently only the clients already mentioned (Java, C/C++, Go) as well as the C# client support Predicate Filters.

Any chances of this supported in aql?

Can someone point me to an example of how to find the last update time of a specific bin? (programmatically on java will be the best) Also, it’s supported only on version >= 5.5 correct?

This is actually not available as far as I know. Versions 5.4 and above have the ability to keep track of bin level LUT in order to leverage the bin convergence feature in XDR but there are no APIs to get this information as far as I know.