I have a collection in mongo which has name and count fields.
{name:\'myName\',count:5}
Is it possible to sort data by count and export as json
You can't pass in an argument to sort your documents by a specific key when using mongoexport.
The way to do this would be to write your own script.
Hope this helps.