On Mar 13, 11:53 am, Patrick Twohig <[email protected]> wrote:
> So, the business requirements of my application need a query which needs to
> search for a property (let's call it "foo") and a date property such that it
> will filter out all objects older than a certain date. I guess in GAE/J
> this would be something like....
>
> Query q = new Query("MyKind")
> .addFilter("foo", GREATER_THAN, 0)
> .addFilter("bar", LESS_THAN, 42)
> .addFilter("date", GREATER_THAN, someDate);
>
> But, I'm guessing that wouldn't work because it's got inequality filters on
> multiple properties. Would there be a way to get a similar result without
> loading a huge amount of entities into memory and filtering them out
> manually?
How about using buckets? For example, denormalize foo > 0 such that
you can use an equality filter:
MyKind.query().filter("foo_nonzero =", True).filter("bar <", 42)
Maybe you could do this with dates as well. For example, as well as
storing the date you could store the week number so that you could use
an equality query for all MyKind occuring in week now+1 and week now
+2, order by date.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.