this is not needed. as we now know that $dm is the DocumentManager, the type of the metadata is known.