Added a check to see if the array is empty to prevent empty arrays on mongo documents from automatically being assigned as a documentset.