I have some documents that appear in the unsynced_documents table because a field is missing. The problem is the field has been added and is present in the document (in Atlas). Is there any way to fix this issue ?
Hi! Is it possible that, when adding a required field, you caused >100,000 documents to become unsyncable (as described here)?
Regardless, if possible I would recommend terminating and re-enabling Sync. That will most likely get you out of this situation.
In the future. if you want to add a required field to your schema without causing Atlas documents to become unsyncable, you can use the default
property in your App Services JSON schema. This will attach the default value to any Atlas documents missing the required field. See more here
Hello,
No, there wasn’t >100,000 unsyncable documents.
I don’t know why those documents showed as unsyncable even though they had the requested field. I even had some documents that were already deleted.
What I did to solve that :
- I opened a sync session on a client that had permission to sync with all documents
- For (allegedly) missing fields I updated them on compass and they disappeared from the unsyncable table
- For deleted documents I inserted one with same _id and deleted it. This made them also disappear from unsyncable documents.
I don’t really know what is the mechanism there but at least it solved the issue !