How to match date filed in Google Datastore

How to match date filed in Google Datastore

Suppose you have an 'Employee' entity with updatedOn field (Date or timestamp type). You can use Date function to parse date string and filter your data.

In GQL, you can use:
  SELECT * FROM EmployeeObj where updatedOn > Date('2014-09-25')

Similarly in objectify, you can use filter
          Objectify obfy = OfyService.ofy();
          List<EmployeeObj> resultList = obfy.load().type(EmployeeObj.class)
.filter("updatedOn > ", Date('2014-09-25'))
                                                 .list();

Popular posts from this blog

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.

Upload file on Google cloud storage using Java servlet on google app engine

Create Nested table inside a table on a pdf document using iText