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

Required properties with default value don't get added to Atlas

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      The issue is quite simple: if the below class is added to MongoDb Realm, the Number property doesn't get added to Atlas. The problem is that when changing the object on Atlas with the required properties missing, Realm Sync schema validation fails, resulting in the error "Failed to apply MongoDB change event to sync history; document is missing required field(s)".

      Unable to find source-code formatter for language: cs. 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
      class SomeObj : RealmObject 
      {
          // Id and Partition properties...
      
          public int Number { get; set; }
      }
      

      Realm schema:

      {
        "title": "SomeObj",
        "required": [
          "Number"
        ],
        "properties": {
          "Number": {
            "bsonType": "int"
          },
          "_id": {
            "bsonType": "string"
          },
          "_partition": {
            "bsonType": "string"
          }
        }
      }
      

      It's the same problem explained on this thread but on the Swift SDK this was only happening because of an update: .modified parameter: I cannot synchronize data between MongoDB Atlas cluster and client application

      Is there any workaround on the .NET SDK besides not setting the values as default?

      Version of Realm and Tooling

      • Flavor:
        • [x] MongoDb Realm
        • [ ] Realm Cloud
        • [ ] Self-Hosted
      • Client SDK Version: 10.0.0-beta3

            Assignee:
            nikola.irinchev@mongodb.com Nikola Irinchev
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: