No results

    MongoDB scripts

    As you develop the model for your MongoDB collection or views, with field-level constraints and indexes, Hackolade dynamically generates corresponding scripts:


    The script can also be exported to the file system via the menu Tools > Forward-Engineering, or via the Command-Line Interface.


    The information can be viewed in the MongoDB Script tab:

    Forward-Engineering - MongoDB Script



    You may toggle between Create and Update views:

    MongoDB script toggle


    A button lets the user apply to a selected instance the script to create databases, collections with optional $jsonschema validator, indexes, and sharding configuration, and sample data if desired.


    For version of MongoDB up to v3.4, the MongoDB script is in aggregation pipeline syntax.  From v3.6 up, the script is in $jsonschema syntax.


    You may export these scripts to a JavaScript file with the menu option Tools > Forward-Engineering > MongoDB Script:

    Forward-Engineering - MongoDB Script file


    The generation of the script can also be triggered with Command-Line Interface.