Uploaded image for project: 'Realm .NET SDK'
  1. Realm .NET SDK
  2. RNET-541

[Migration] NewRealm.Remove() is not working

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • Q4-22FY
    • Affects Version/s: None
    • Component/s: None

      Discussed in https://github.com/realm/realm-dotnet/discussions/2583

      <div type='discussions-op-text'>

      <sup>Originally posted by vardansargsyan92 August 26, 2021</sup>
      Hello.

      I have a migration function that removes "Redundant" objects coming from the old realm database into the new realm database. The problem is that when migration happens
      and the NewRelam.Remove() method is called it does nothing. The objects still exist in the database.

      So what I should do to somehow "SKIP" or "IGNORE" those objects?</div>

      According to the code snippet posted in the discussion, doing something like:

      Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      var toDelete = migration.NewRealm.All<Foo>().ElementAt(0);
      migration.NewRealm.Remove(toDelete);
      

      fails to the delete the target object. We should write a unit test to verify.

            Assignee:
            nikola.irinchev@mongodb.com Nikola Irinchev
            Reporter:
            nikola.irinchev@mongodb.com Nikola Irinchev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: