Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-2480

Need a way to reset Realm db Models

      Problem

      Currently we have deleteAll() method in realm which help use to delete all models from realm. But there are N number of use case where we need a way to reset the db instead deleting the models. By now, we can only do it a way getting all objects and delete it.
      But we need a way to reset the model without we do all this.

      For example: if a user change from one region to another. We need to remove all pref and data from the region and add new data. If we use deleteAll() it also losing the it reference which causing errors.

      Solution

      Implementation of resetAll() and reset(['Model1', 'Model2']) which helps to reset data instead of calling a objects of all models and deleting it.

      Alternatives

      No response

      How important is this improvement for you?

      Would be a major improvement

      Feature would mainly be used with

      Local Database only

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: