note 104754 modified in mongocursor.sort by danbrown
| From: | danbrown@php.net | Date: | Tue, 05 Jul 2011 19:59:58 +0000 |
| Subject: | note 104754 modified in mongocursor.sort by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-181265@lists.php.net to get a copy of this message | ||
Here both arrays are equal
<?php
// sort date ascending and age descending
$cursor->sort(array('date' => 1, 'age' => -1));
// sort age descending and date ascending
$cursor->sort(array('age' => -1, 'date' => 1));
?>
--was--
Here both arrays are equal
// sort date ascending and age descending
$cursor->sort(array('date' => 1, 'age' => -1));
// sort age descending and date ascending
$cursor->sort(array('age' => -1, 'date' => 1));
http://php.net/manual/en/mongocursor.sort.php