> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
Sadly, we can't do that in the driver, because commands "will return a
single document with the command results"
(http://www.mongodb.org/display/DOCS/Commands). So your only way for
sorting would be to do this in your application. For example with
http://docs.php.net/uasort
cheers,
Derick
--
http://mongodb.org | http://derickrethans.nl
twitter: @derickr and @mongodb
> yes, its sadly, but i think it can do with map\reduce, write some js-
> function and sort it, but i dont know how it make
Actually, It's fairly trivial to do this in your application (with PHP's
uasort()). I don't quite understand why you are insisting to do this on
the server side? It's probably going to be easier to do this in PHP, but
in order to help you I would need to see some (simple, but working)
example code.
Also, in a future MongoDB server version, the new aggregation
framework would allow you to group by/distinct and sort.