added missing case in sortedArrayForArray for isDocument sorting