Connecting to MongoDB Atlas
MongoDB Atlas uses SRV connection strings. Enter your Atlas cluster hostname (e.g.cluster0.abc123.mongodb.net) as the host. Cobi detects the SRV pattern automatically and handles the port for you.
Connecting to a Self-Hosted MongoDB
Enter your server’s hostname or IP address and port (27017 by default).
Schema Conventions
Cobi maps MongoDB collections to SQL tables. Keep the following in mind when chatting with the Data Assistant:| Convention | Detail |
|---|---|
| Collections | Each collection appears as a table |
_id field | Present on every document as a unique identifier, used as the primary key |
| Nested fields | Flattened with underscores, so address.city becomes address_city |
| Arrays | Array fields are queryable. Ask the Data Assistant to expand or filter them |
| Relationships | MongoDB has no foreign keys. Reference related collections by matching field values |
Create a Read-Only User
Self-hosted MongoDB: run the following inmongosh:
read role scoped to your database.