CreateSchema
Generates a schema file based on the structure of a specified MongoDB collection, defining fields and data types.
CreateSchema
Creates a local schema file (.rsd) from an existing table or view in the data model.
The schema file is created in the directory set in the Location connection property when this procedure is executed. You can edit the file to include or exclude columns, rename columns, or adjust column datatypes.
The server checks the Location to determine if the names of any .rsd files match a table or view in the data model. If there is a duplicate, the schema file will take precedence over the default instance of this table in the data model. If a schema file is present in Location that does not match an existing table or view, a new table or view entry is added to the data model of the server.
Input
| Name | Type | Description |
| SchemaName | String | The name of the schema to create for the MongoDB collection. |
| TableName | String | The name of the MongoDB collection for which the schema will be generated. |
| FileName | String | The full file path and name where the generated schema definition will be saved. |
| TableType | String | Specifies the type of schema representation to generate. Allowed values: 'Collection' (standard collection schema), 'ArrayObject' (schema for array-based structures), 'View' (schema for MongoDB views). |
Result Set Columns
| Name | Type | Description |
| Result | String | Indicates whether the schema generation was successful. Returns 'Success' if completed successfully, otherwise returns 'Failure'. |