How to store/retrieve date in Aerospike database?

How to store date in Aerospike database and retrieve data based on this date.

Consider query like Select * From Users Where StartDate < now(), how to retrieve data like this in Aerospike database??

  1. Use a bin to hold the DateTime value as an integer
  2. Create a numeric secondary index on this bin
  3. Use a query with range filter to get the records back.

You can use the Unix/epoch time standard = number of seconds since January 1, 1970

2 Likes

Thanks for quick response.