Magma collection - where:
Facundo Vozzi
facundov79 at gmail.com
Sat Nov 13 21:31:12 UTC 2010
Hi,
I've this code:
- self customers select: [:aCustomer | aCustomer name asUppercase
beginsWith: firstsLetterOfName asUppercase]
It works ok and with good perfomance but "customers" is a magma collection
so I would like use where: because the collection has a index on #name
attribute.
- self customers where: [:each | aCustomer name
= firstsLetterOfName asUppercase]
It works but I had two problems, the first one is that the
meaningfulCharacters of MaSearchStringIndex is 5 and then it works if I
write exactly the 5 firsts letter of the name. The second problem is that I
can't send asUppercase beacuse name is a MaClause.
So, my question is: Can I use where: for this funcionality or I need use
select:? If you think that where: is appropiate, Do I need create a new king
of index to reach that?
Thank you,
Facu
p.s.: I'm using the first code in the method of customersOfNameBeginsWith:
selector and i used it on a autocompletation jquery input control.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/magma/attachments/20101113/fa2940ed/attachment.htm
More information about the Magma
mailing list