Sort is easy. When you want your results to be sorted in a particular order, you just specify the sorting criteria in a Json object.

Lets say you want to retrieve all documents from our “address” collection in the alphabetical order of “State” names, you would simply enter the appropriate Json in the Sort popout box as shown below:

image

You can read more about MongoDB Sorting here.

Tags: , ,