Spring Data Mongodb not sorting properly on null values
<p>I am facing one issue while using the mongodb sorting. By default sorting takes place on null values as first elements for ascending order and last elements in descending order. For one of my requirement i have to display all null values at last place irrespective of the sorting order. </p>

<p>If it is single column, it should be fine. But i have to sort on multiple fields at a time. And for all the fields it has to take consider all null values as last values. </p>

<p>Is there any way that Mongodb supports for this. I am using spring data. Thought spring sort provides the feature of Null Last as the parameter, some how it is not working. </p>