{"action":"opened","issue":{"url":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1877","repository_url":"https://api.github.com/repos/doctrine/mongodb-odm","labels_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1877/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1877/comments","events_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1877/events","html_url":"https://github.com/doctrine/mongodb-odm/issues/1877","id":369575760,"node_id":"MDU6SXNzdWUzNjk1NzU3NjA=","number":1877,"title":"Update identifier","user":{"login":"alanpoulain","id":10920253,"node_id":"MDQ6VXNlcjEwOTIwMjUz","avatar_url":"https://avatars1.githubusercontent.com/u/10920253?v=4","gravatar_id":"","url":"https://api.github.com/users/alanpoulain","html_url":"https://github.com/alanpoulain","followers_url":"https://api.github.com/users/alanpoulain/followers","following_url":"https://api.github.com/users/alanpoulain/following{/other_user}","gists_url":"https://api.github.com/users/alanpoulain/gists{/gist_id}","starred_url":"https://api.github.com/users/alanpoulain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanpoulain/subscriptions","organizations_url":"https://api.github.com/users/alanpoulain/orgs","repos_url":"https://api.github.com/users/alanpoulain/repos","events_url":"https://api.github.com/users/alanpoulain/events{/privacy}","received_events_url":"https://api.github.com/users/alanpoulain/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-12T14:28:01Z","updated_at":"2018-10-12T14:28:01Z","closed_at":null,"author_association":"NONE","body":"In API Platform (https://github.com/api-platform/core), we would like to allow an update of the identifier.\r\nHowever it is not possible in mongodb-odm.\r\nFor instance, given this id of a document:\r\n```php\r\n /**\r\n * @ODM\\Id(strategy=\"NONE\", type=\"string\")\r\n */\r\nprivate $slug;\r\n```\r\nIt's not possible to update it because of:\r\nhttps://github.com/doctrine/mongodb-odm/blob/da5074b8b54f0e4c0d342d15c56dd054d4a136a7/lib/Doctrine/ODM/MongoDB/Persisters/PersistenceBuilder.php#L121-L124\r\n(first related commit: https://github.com/doctrine/mongodb-odm/commit/ed789d7e7d5a75d41b8d49e04a4c65bd97343a96)\r\nI think it should be possible if the document is replaced by another with the modified identifier.\r\nWDYT?"}}
{"actor":{"display_login":"alanpoulain"}}