Add nonzero method to check if document is empty or not.