your code seems to be fine to me. Are you aware, that MongoDB does not
support locales in sorting? It will sort only by the default english
alphabet, and also case sensitive: uppercase letters will precede the
lower case letters.
So this is a 'valid' alphabetical sort by the mongo:
1984, December, February, January, apple, banana, foobar
--
Nagy Attila Gabor
does it work for other fields? (string or number type?)
--
Nagy Attila Gabor
hmm, what is this 'tenant()' method doing on your Messages::model()?
does it return the original model?
--
Nagy Attila Gabor
$return_messages = Messages::model()->findAll($criteria);