Moon ModelerSchema Design Tool
for Azure Cosmos DB

FREE 14 days trial. No card required.
  • Native Cosmos DB Connection A dedicated connection type, new in version 13.5
  • Reverse Engineering Collections and embedded documents in one diagram
  • Validation Scripts Generate schema validation from your model
  • Excellent ROI Pay once, use forever
How do I visualize an Azure Cosmos DB database?

Create a CosmosDB connection in Moon Modeler, enter the account URL, sign in with SCRAM-SHA-256, turn on TLS and click Connect and load existing database structure. Moon Modeler reads the collections and draws the diagram for you.

Learn more about Moon Modeler

Which Cosmos DB accounts can I connect to?

Accounts that use Azure Cosmos DB for MongoDB. Accounts created for the NoSQL, Cassandra, Gremlin or Table APIs don't speak the MongoDB protocol and can't be loaded into Moon Modeler.

Connect Azure Cosmos DB to Moon Modeler
and Visualize Your Collections

Step 1: Create a CosmosDB Connection

Click Connections on the main toolbar, then Create new connection and select the CosmosDB tab. Enter a name and fill in the URL in the form mongodb://<account>.mongo.cosmos.azure.com:10255. You can find the host and port on the Connection strings page of your account in the Azure portal.

Leave Retry writes off unless you enabled Retryable Writes on your Cosmos DB account.

CosmosDB connection with account URL and database in Moon Modeler
CosmosDB connection in Moon Modeler
SCRAM-SHA-256 authentication settings for a Cosmos DB connection in Moon Modeler
SCRAM-SHA-256 authentication for Cosmos DB

Step 2: Set Up Authentication

Go to the Authentication tab and select SCRAM-SHA-256. The username is the name of your Cosmos DB account and the password is the primary password from the Connection strings page in the Azure portal. Leave Auth. Db empty.

Step 3: Enable TLS

Azure Cosmos DB accepts encrypted connections only. On the SSL/TLS tab, turn on Enable TLS. No certificate files are needed.

Go back to the Server tab. If you didn't type the database name, click Load and select and choose the database you want to visualize. Then save the connection.

SSH/SSL/TLS connections are supported for MongoDB databases in the Professional Edition.

Enable TLS option for a Cosmos DB connection in Moon Modeler
TLS enabled for a Cosmos DB connection
Connect and load existing database structure link for a Cosmos DB connection
Saved Cosmos DB connection

Step 4: Connect and Load the Database Structure

The new connection appears in the list with a TLS badge. Click Connect and load existing database structure and Moon Modeler reads the collections, fields and embedded documents from Cosmos DB.

Step 5: Explore and Document the Diagram

Moon Modeler creates a new project with the diagram. Embedded objects are displayed as separate objects linked to their parent collection, so the nesting is easy to follow.

Add descriptions, notes and sample data, arrange collections into sub-diagrams and share the result as an interactive HTML report or PDF.

Collection with embedded documents loaded from Azure Cosmos DB into Moon Modeler
Cosmos DB database structure in Moon Modeler
Troubleshooting: Old MongoDB Server Version
Notification: server reports maximum wire version 7, but the driver requires at least 8 (MongoDB 4.2)
Wire version error in the Notifications list

"Server Reports Maximum Wire Version 7"

Moon Modeler 13.5 uses a MongoDB driver that needs MongoDB server version 4.2 or later. If your Cosmos DB account still runs an older server version, loading fails with an error saying that the server reports maximum wire version 7 but the driver requires at least 8.

The message is shown in an error dialog and stays in the Notifications list. The fix is on the Azure side: update the server version of your account.

Check the Server Version in Azure

In the Azure portal, open your Cosmos DB account and go to Settings → Features. The Update MongoDB server version row shows the version your account runs right now.

Features page of an Azure Cosmos DB for MongoDB account showing the current server version
Current MongoDB server version of a Cosmos DB account
Update MongoDB server version panel in the Azure portal
Updating the MongoDB server version in the Azure portal

Update the MongoDB Server Version

Click Update MongoDB server version, pick a version of 4.2 or later in Select MongoDB Version and click Enable. Try it on a non-production account first to make sure your applications work with the new version.

Updating from version 3.2 changes the host name to <account>.mongo.cosmos.azure.com. Update the URL in the Moon Modeler connection, then load the structure again.

Design New Collections and Generate Scripts

Moon Modeler works in both directions. Click New on the main toolbar and select CosmosDB in the New project dialog to start a model from scratch. Design collections visually, define fields, embedded documents and references, and generate validation and creation scripts for your Cosmos DB database.

Already have a MongoDB model? Click Convert on the main toolbar and choose Convert to CosmosDB.

Read more about Cosmos DB

New project dialog in Moon Modeler with MongoDB, CosmosDB, DocumentDB and Mongoose
New project dialog in Moon Modeler
Frequently Asked Questions on Schema Design for Azure Cosmos DB
Which Cosmos DB API does Moon Modeler support?

Azure Cosmos DB for MongoDB. Accounts created for the NoSQL, Cassandra, Gremlin or Table APIs don't speak the MongoDB protocol and can't be loaded into Moon Modeler.

Why do I get the error 'server reports maximum wire version 7'?

Your Cosmos DB account runs a MongoDB server version older than 4.2. Update it in the Azure portal under Settings → Features → Update MongoDB server version, then load the structure again.

Where do I find the username and password for Cosmos DB?

On the Connection strings page of your account in the Azure portal. The username is the account name and the password is the primary password.

Can I generate validation scripts for Cosmos DB?

Yes. Design collections visually or load them from the database and generate validation and creation scripts from your model.

Is my data model stored in the cloud?

No. Moon Modeler is a desktop application for Windows, macOS and Linux. Database connections and data models stay on your computer.