The schema generation tool mongodrdl outputs a schema
file in Document Relational Definition Language (DRDL)
format. Examine the generated schema's table structure and field types
to verify that the generated schema supports your reporting
requirements.
You can manually edit the schema definition files to perform the following actions:
Add fields that
mongodrdldidn't discover within the subset of documents that it sampledRemove fields
Remove tables
Rename tables, so long as the
collectionfield remains the sameRename fields using the
sqlnameoption
Important
To apply any changes you make to your DRDL files, you must restart
mongosqld.
BI Connector does not recognize geospatial fields when reading from a view.
When you're done editing your .drdl file, you can follow the steps in
one of the following options:
Option 1. Upload the schema, give it a name, and start
mongosqld, specifying both the schema's name, source, and mode, as in the following steps:Use
mongodrdltouploadthe schema to your MongoDB deployment, similar to the following example:mongodrdl upload --host <hostName> --schemaSource schemas --drdl ./movies.drdl The string representation of the ObjectId of the uploaded schema is returned:
5d793f3f6a26a3ce66c304ea Name your schema, using the
name-schemacommand, similar to the following example:mongodrdl name-schema --name movies --schemaSource schemas --schema 5d793f3f6a26a3ce66c304ea Start
mongosqldwith a named schema, using--schemaSource,--schemaMode, and--schemaNameoptions, similar to the following example:mongosqld --schemaMode custom --schemaSource schemas --schemaName movies
Option 2. Start
mongosqldwith the--schemaoption to specify the path to the.drdlschema file.