Hey Y’all - thanks for the comments here - I will comment here that from the client, your mobile app class definitions, you should be able to:
- Add a Class
- Add a Field
- Remove a Class
- Remove a Field
Without needing to trigger a re-sync on the server. The client should be able to sync with a subset of classes that are defined on the cloud. If you define an extra class on the server side, then yes, you will need to add this class to to your server side schema - but it should not trigger a resync. If you are encountering different behavior with any of the above I have described then please let us know.
The above are interpreted as “additive” changes - A destructive change is defined as:
- Changing the primary key
- Changing a field from required to optional, or vice versa
- Changing a field type but keeping the name the same
- Dropping a collection in MongoDB that was already synced - this is because there is sync history metadata stored for this collection
- Deleting Classes or Fields from your cloud sync schema
The above destructive changes will necessitate a full re-sync, ie. a termination of sync on the cloud and the re-enablement.
If you are looking to make a destructive change then you can do two things, both follow an “API versioning” methodology -
- If you need to make a destructive change on class you can increment the version on the class. ie - Account vs AccountV2
- If you need to make a destructive change on a field you can increment the version on the field. ie -
name vs nameV2
In this way, both version will be able to co-exist out in the wild without the need of a re-sync. You can use triggers to copy data between them if necessary. I hope this helps, let me know if you have any questions
Best
Ian