My aim is sort rfc 822 timestamp format which is stored in Mongodb as a pubdate field . I do not want to fetch all the records using PHP/Python and sort using it as lot of records will be required to be placed on memory. I am putting down an example below how my mongo fields look , like this I have million number of records -
"pubdate" : [ "Sun, 22 Jun 2014 06:52:56 +0000" ], "title" : [ "Al-Qaida militants kill senior Yemeni army officer" ]
"pubdate" : [ "Sun, 21 Jun 2014 06:52:56 +0000" ], "title" : [ "He went to paradise" ]
"pubdate" : [ "Sun, 20 Jun 2014 06:52:56 +0000" ], "title" : [ "Legacy of USA" ]
I require sorting on pubdate field which in turn will be called by PHP