Add `Realm.delete(RealmList)` and `Realm.delete(RealmResults) to remove RealmObjects
See original GitHub issueCocoa binding has the similar functions See https://realm.io/docs/swift/latest/api/Classes/Realm.html#/s:FC10RealmSwift5Realm6deleteuRq_Ss12SequenceTypedqqq_S1_9GeneratorSs13GeneratorType7ElementCS_6Object_FS0_Fq_T_
Currently, All objects in RealmResults
can be deleted by RealmResults.clear()
But there is no function to delete all objects from RealmList
Issue Analytics
- State:
- Created 8 years ago
- Comments:14 (10 by maintainers)
Top Results From Across the Web
How do I delete Realm objects which are not referenced by ...
Then you can delete any objects where: RealmResults<Direction> unusedDirections = realm.where(Direction.class).isEmpty("routes").findAll();.
Read more >Read & Write Data - Java SDK — Realm - MongoDB
To delete an object from a realm, use the deleteAllFromRealm() method of the RealmResults instance that contains the objects you would like to...
Read more >Realm Database on Android: Getting Started
Over the course of this tutorial, you'll learn about: Realm database; Schema and entities; Inserting objects; Querying and deleting objects ...
Read more >Integrating Realm Database in an Android Application - Auth0
You can delete the Realm file with the following code in the TaskListApplication . Remember to remove the Realm.deleteRealm(realmConfig) ...
Read more >Create reactive mobile apps in a fraction of the time - Realm
Step 1: Add the following class path dependency to the project level build.gradle ... Setting the RealmObject field to null will clear the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We probably need to consider our whole API in this area, as right now it isn’t as clear as one could hope IMO. I think the original idea was to stick as close to the Java Collection API methods as possible, which makes a lot of sense. However, how they work differ based on the type, which makes the API harder to understand:
Maybe it would make more sense to use the RealmList semantics everywhere? That would be more inline with Java semantics, would allow people to manipulate the results outside a write transaction, and would allow people to up-cast RealmResults to List without problems.
Given that you need a write-transaction anyway to actually delete the Realm data. Adding special methods for removing would probably be cleaner?
Objective C uses
delete*
instead ofremove*
. Something worth considering if we moved away from the collection API methods anyway.What do you think?
it says cannot resolve method ‘deleteAll()’ when i am using
Realm.deleteAll()