Docs Menu
Docs Home
/ /
Atlas App Services
/ /

Generate SDK Object Models

On this page

  • Overview
  • Procedure

Atlas App Services can automatically translate your server-side document schemas to a Realm Object Schema that will work with your SDK of choice. You can generate the object models using either the App Services UI or CLI.

1

To begin, navigate to the SDKs screen under the Build section in the left navigation menu. Here you will find the tools to make your app compatible with different SDKs.

2

In the Data Models tab, you can view the generated object models for your SDK. Use the Language dropdown to choose the language you are using for development. The page updated with a generated version of each of your object types translated to the language you choose.

Supported languages for object models
3

Click on the Copy All Data Models button to copy the code for all object models. If prompted, choose whether you want to include the import statements (the default is to include them) and then click the Copy button. You are now ready to paste these generated object models into your own app code.

Copy the data model pop up
1

To begin generating the data object models for your app, run the following:

appservices schema datamodels -a "<Your App ID>"
2

You will be prompted for the following details:

? Select the language you would like to generate data models in
? Would you like to omit imports?
? Would you like group all generated data models together?
  1. Select from the list of available languages which language you would like your object models to be in

  2. Choose whether you'd like to omit import statements from your data models

  3. Choose whether you'd like the data model for each schema to be grouped together in the output

3

Copy and paste the object models from your terminal into your code.

Back

Create a Data Model

On this page