I'm working on a golang backend run on Google App Engine. I have an Entity called Recruit
that has a property
UpdatedAt time.Time `datastore:"updated_at"`
I would like to query Recruits by their updated time. My first instinct is to use a filter.
query = datastore.NewQuery("Recruit").Filter("updated_at <=", updatedAt)
where updatedAt is a string. I've tried the forms 2014-08-28 01:53:19
and 2014-08-28T01:53:19.00618Z
(The former is the form the time.Time property takes in the datastore, while the latter is how it propagates in JSON.)
When I call the query with <=
, all Recruit objects are returned. When calling with >=
, null is returned. I'm quite sure I'm testing with a time in the middle of the data set.
When I test on console.developers.google.com, the console filters support a date and time
after/before
, but trying to replace <=
with after
results in an error.
Has anyone managed to filter queries by date or time?