if you want to not manage a document anymore through the API, use $dm->detach($document)