{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-java/issues/1560","labels_url":"https://api.github.com/repos/realm/realm-java/issues/1560/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-java/issues/1560/comments","events_url":"https://api.github.com/repos/realm/realm-java/issues/1560/events","html_url":"https://github.com/realm/realm-java/issues/1560","id":110589843,"number":1560,"title":"Add `Realm.delete(RealmList)` and `Realm.delete(RealmResults) to remove RealmObjects","user":{"login":"beeender","id":449296,"avatar_url":"https://avatars.githubusercontent.com/u/449296?v=3","gravatar_id":"","url":"https://api.github.com/users/beeender","html_url":"https://github.com/beeender","followers_url":"https://api.github.com/users/beeender/followers","following_url":"https://api.github.com/users/beeender/following{/other_user}","gists_url":"https://api.github.com/users/beeender/gists{/gist_id}","starred_url":"https://api.github.com/users/beeender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beeender/subscriptions","organizations_url":"https://api.github.com/users/beeender/orgs","repos_url":"https://api.github.com/users/beeender/repos","events_url":"https://api.github.com/users/beeender/events{/privacy}","received_events_url":"https://api.github.com/users/beeender/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-java/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/realm/realm-java/labels/P1","name":"P1","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-09T05:33:25Z","updated_at":"2015-10-09T06:01:33Z","closed_at":null,"body":"Cocoa binding has the similar functions\r\nSee https://realm.io/docs/swift/latest/api/Classes/Realm.html#/s:FC10RealmSwift5Realm6deleteuRq_Ss12SequenceTypedqqq_S1_9GeneratorSs13GeneratorType7ElementCS_6Object_FS0_Fq_T_\r\n\r\nCurrently, All objects in `RealmResults` can be deleted by `RealmResults.clear()`\r\nBut there is no function to delete all objects from `RealmList`"},"comment":{"url":"https://api.github.com/repos/realm/realm-java/issues/comments/146762863","html_url":"https://github.com/realm/realm-java/issues/1560#issuecomment-146762863","issue_url":"https://api.github.com/repos/realm/realm-java/issues/1560","id":146762863,"user":{"login":"beeender","id":449296,"avatar_url":"https://avatars.githubusercontent.com/u/449296?v=3","gravatar_id":"","url":"https://api.github.com/users/beeender","html_url":"https://github.com/beeender","followers_url":"https://api.github.com/users/beeender/followers","following_url":"https://api.github.com/users/beeender/following{/other_user}","gists_url":"https://api.github.com/users/beeender/gists{/gist_id}","starred_url":"https://api.github.com/users/beeender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beeender/subscriptions","organizations_url":"https://api.github.com/users/beeender/orgs","repos_url":"https://api.github.com/users/beeender/repos","events_url":"https://api.github.com/users/beeender/events{/privacy}","received_events_url":"https://api.github.com/users/beeender/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T06:01:33Z","updated_at":"2015-10-09T06:01:33Z","body":"The problem of `allow people to manipulate the results outside a write transaction` is, it has the same problem with the concept `detach` we discussed a lot before.\r\n\r\nIf we allow user to manipulate the `RealmList` as a normal `List` without changing anything in the Realm, that means, the `RealmList` should be detach from Realm first.\r\n\r\nI think Cocoa's approach makes sense. It only has `List.removeAll()` which is the same with `RealmList.clear()`, but no `Results.clear()`.\r\n\r\nMaybe we should consider to move this functionality to `Realm`, since the `createObject` function is in `Realm`."}}