Sorting on sub-document.

Fixed sorting functionality on sub-document specified in view.