{"action":"created","issue":{"url":"https://api.github.com/repos/bwaldvogel/mongo-java-server/issues/107","repository_url":"https://api.github.com/repos/bwaldvogel/mongo-java-server","labels_url":"https://api.github.com/repos/bwaldvogel/mongo-java-server/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/bwaldvogel/mongo-java-server/issues/107/comments","events_url":"https://api.github.com/repos/bwaldvogel/mongo-java-server/issues/107/events","html_url":"https://github.com/bwaldvogel/mongo-java-server/issues/107","id":511933818,"node_id":"MDU6SXNzdWU1MTE5MzM4MTg=","number":107,"title":"It's possible to create duplicate indexes on collections","user":{"login":"Gaff","id":226665,"node_id":"MDQ6VXNlcjIyNjY2NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/226665?v=4","gravatar_id":"","url":"https://api.github.com/users/Gaff","html_url":"https://github.com/Gaff","followers_url":"https://api.github.com/users/Gaff/followers","following_url":"https://api.github.com/users/Gaff/following{/other_user}","gists_url":"https://api.github.com/users/Gaff/gists{/gist_id}","starred_url":"https://api.github.com/users/Gaff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gaff/subscriptions","organizations_url":"https://api.github.com/users/Gaff/orgs","repos_url":"https://api.github.com/users/Gaff/repos","events_url":"https://api.github.com/users/Gaff/events{/privacy}","received_events_url":"https://api.github.com/users/Gaff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-10-24T13:08:59Z","updated_at":"2019-11-01T17:42:27Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI discovered that I can add a duplicate index (with the same name) onto a collection and it behaves just fine. This is because `AbstractMongoCollection.addIndex()` doesn't check the index name.\r\n\r\nYou only see an error when you drop the database, this is because `AbstractMongoCollection.dropIndex()` calls `CollectionUtils.getSingleElement()` which will fail because it actually contains duplicates!\r\n\r\nNot sure how best to fix, but I'd suggest `addIndex()` should check that names are unique?\r\n"},"comment":{"url":"https://api.github.com/repos/bwaldvogel/mongo-java-server/issues/comments/548883263","html_url":"https://github.com/bwaldvogel/mongo-java-server/issues/107#issuecomment-548883263","issue_url":"https://api.github.com/repos/bwaldvogel/mongo-java-server/issues/107","id":548883263,"node_id":"MDEyOklzc3VlQ29tbWVudDU0ODg4MzI2Mw==","user":{"login":"Gaff","id":226665,"node_id":"MDQ6VXNlcjIyNjY2NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/226665?v=4","gravatar_id":"","url":"https://api.github.com/users/Gaff","html_url":"https://github.com/Gaff","followers_url":"https://api.github.com/users/Gaff/followers","following_url":"https://api.github.com/users/Gaff/following{/other_user}","gists_url":"https://api.github.com/users/Gaff/gists{/gist_id}","starred_url":"https://api.github.com/users/Gaff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gaff/subscriptions","organizations_url":"https://api.github.com/users/Gaff/orgs","repos_url":"https://api.github.com/users/Gaff/repos","events_url":"https://api.github.com/users/Gaff/events{/privacy}","received_events_url":"https://api.github.com/users/Gaff/received_events","type":"User","site_admin":false},"created_at":"2019-11-01T17:42:27Z","updated_at":"2019-11-01T17:42:27Z","author_association":"NONE","body":"ok looks good - thanks :)"}}
{"actor":{"display_login":"Gaff"}}