Handle Date, DateTime and empty arrays in hash_from_document