Querying by date

38 views
Skip to first unread message

David Marí

unread,
Feb 15, 2015, 10:41:17 AM2/15/15
to activate-p...@googlegroups.com
Hi here,

I’m new to Activate and so far it looks great.

I can’t find how to query by date though.

I’d like to do something similar to:
transactional {
val now = new Date()
query {
(a: Article) => where((a.published :== true) :&& (a.pubDate :<= now)) select(a)
}
}
But although it works without :&& (a.pubDate :<= now) (or with other conditions), it just doesn’t return anything when adding this part of the query.

What am I doing wrong? :)

Thanks,

--
David Marí

Flavio W. Brasil

unread,
Feb 15, 2015, 10:48:29 AM2/15/15
to David Marí, activate-p...@googlegroups.com
Hi David,

The query looks to be correct. Could you try to test if it works using `:>=` or `:==`?
Is `pubDate` using Date as well?

Regards,

-- 
Flavio W. Brasil

--
You received this message because you are subscribed to the Google Groups "Activate Persistence Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to activate-persist...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Marí

unread,
Feb 15, 2015, 4:12:24 PM2/15/15
to Flavio W. Brasil, activate-p...@googlegroups.com
Hi,

Thanks Flavio. It was indeed correct. My bad messing around with test data u_u

Cheers,

--
David Marí

El 15/02/2015, a les 16:48, Flavio W. Brasil <fwbr...@gmail.com> va escriure:
Reply all
Reply to author
Forward
0 new messages