Say I have an OrderedCollection with instances of XXX that has a field "date" and I create a a equality index on it. So... ok, I can do the
select: { :entry | entry.date = aDate } But... I would love to take advantage of the index and also do this: sorted: {:a :b | a.date <= b.date } Is there a way to do that? Thanks in advance _______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
mmmm maybe the btrees do no help for sorting.. On Fri, Aug 4, 2017 at 4:07 PM, Mariano Martinez Peck <[hidden email]> wrote:
_______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
In reply to this post by GLASS mailing list
Mariano, Here's a doit that illustrates 3 different ways to get at sorted
dates from an indexed collection. For the query I happen to be
using a date that predates al of the dates in the collection, but
if you had a specific range in mind the #readStream or #do:
methods allow you to access the elements in sorted order ...
#sortAscending: produces an array with all of the elements sorted
... On 8/4/17 12:07 PM, Mariano Martinez
Peck via Glass wrote:
_______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
On Mon, Aug 7, 2017 at 10:15 PM, Dale Henrichs via Glass <[hidden email]> wrote:
Thanks Dale, that snippet was of great help as I wasn't aware of any of them. This is very cool. Good job on improving all index support!!!
_______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
Free forum by Nabble | Edit this page |