Cosmocloud Build Documentation
DocumentationTutorials
  • Welcome to Cosmocloud
  • Getting Started
    • 1. Organisations
    • 2. Projects
    • 3. Connect your Database
    • 4. Create Database Models
    • 5. Create APIs
    • 6. Testing Free Tier APIs
  • Free Tier
    • Connecting with MongoDB Data APIs
  • Templates
    • CRUD APIs
    • Entity Search APIs
    • Fetch / Upload Media APIs
  • Examples - How To?
    • Making an external API call
    • Reusable Flows - SubFlows
    • Creating Custom Error Responses
    • Flow Builder - Building Conditional Logics
    • Flow Builder - Utilising Loops
    • Creating Dynamic Queries
    • Accessing Auth Tokens in APIs
    • How to upload/download media in Object Storage
  • Resources
    • APIs
      • Checking Logs
    • SubFlows
    • Models
      • Building Models
    • Environments
      • Environment Tier Types
    • Secrets
      • Custom Secrets
    • Databases
    • Releases
    • Vector Search
      • Create a Vector Search Index
      • Edit a Vector Search Index
      • Delete a Vector Search Index
    • Document Search
      • Full Text Search
        • Concepts
          • Indexing in full-text search
          • Data processing using Analyzers
        • Create a Search Index
        • Creating a Custom Analyzer
        • Full Text Search FAQ
      • Vector Search
    • Object Storage
  • Flow Builder
    • Node Types
      • Trigger Nodes
        • HTTP Response
      • Conditional Nodes
        • If Else
        • If Else V2
        • Switch Case
      • Crypto Nodes
        • PBKDF2 Hmac Hash
      • Debug Node
      • Database Nodes
        • Delete One
        • Delete Many
        • Fetch By ID
        • Find One
        • Find Many
        • Insert One
        • Insert Many
        • List Records
        • Run Aggregation Pipeline
        • Update One
        • Update by ID
        • Update Many
      • External Nodes
        • Fire Events (SQS)
        • API Call
        • Delete storage objects
        • Execute SubFlow
        • Get Presigned URL
        • Post Presigned URL
        • Send EMAIL (SES)
        • Send SMS (SNS)
      • Loop Nodes
        • For loop
        • While loop
      • Variable Nodes
        • Arrays
          • Append array
          • Contains
          • Check array empty
          • Extend array
          • Get Array Item
          • Length of array
          • Reverse array
          • Sort array
        • Date and Time
          • Set current datetime
        • Strings
          • Append String
          • Concat Strings
          • Convert to String
          • Length of String
          • Slice String
          • Split String
          • String Operations
          • To Lower
          • To Upper
          • Trim String
        • Mathematical
          • Add Variable
          • Complex Math Expr
          • Decrement Variable
          • Divide Variable
          • Increment Variable
          • Multiply Variable
          • Subtract Variable
        • JSON
          • Build JSON Object
          • Merge JSON Objects
          • Object to String
          • Update JSON Object
        • Special
          • Build Map
          • Set Variable
          • Exists Check
    • Node name
    • CQL - Cosmocloud Query Language
      • Building Expressions
        • $abs
        • $add
        • $addDate
        • $arrayElemAt
        • $avg
        • $buildDateTime
        • $buildMap
        • $ceil
        • $cond
        • $divide
        • $floor
        • $getDay
        • $getHour
        • $getMinute
        • $getMonth
        • $getSecond
        • $getYear
        • $ifNull
        • $max
        • $min
        • $mod
        • $multiply
        • $pow
        • $subtract
        • $sqrt
      • Building Conditions
        • Compound Operators
          • $and
          • $or
        • Conditional Operators
          • $eq
          • $gt
          • $gte
          • $lt
          • $lte
          • $neq
      • Magical Autocomplete
  • Advanced Guide
    • Configuring Authentication
      • SSO Providers
        • AWS Cognito
      • Authentication Concepts
    • MongoDB Query Language
      • Limitations
    • Performance Considerations
      • Instant Deployments
  • User Management
  • Billing and Payments
    • Billing Portal
  • Help & Support
  • References
    • Change log
    • Available Cloud & Regions
Powered by GitBook
On this page
  • Linking your Database
  • Steps to connect you cluster
  1. Getting Started

3. Connect your Database

Previous2. ProjectsNext4. Create Database Models

Last updated 1 year ago

Cosmocloud champions your data sovereignty with the innovative BYOD model - Bring Your Own Database.

Take complete control of your data, knowing that we prioritise your ownership above all. At Cosmocloud, your privacy is paramount; we never own your data. Experience true autonomy and peace of mind, as Cosmocloud empowers you to steer your projects with full confidence and security.

Cosmocloud can spin up dedicated databases for you in Pro projects, on demand. To get Cosmocloud to spin up dedicated databases for Pro projects, reach out to .

Linking your Database

Start by linking your own MongoDB Database with Cosmocloud's project. On Free Tier, Cosmocloud only supports MongoDB Atlas's Data APIs to connect to your database. As you upgrade to Pro, Cosmocloud uses native connection pools (using MongoDB SDK) to connect.

It is not advised to use a Free Tier Project for Production use cases. Checkout how to upgrade to a Pro Project.

Currently, Cosmocloud only supports MongoDB, but integration with more databases is in works behind the scenes and we’ll bring them to you soon!

Steps to connect you cluster

Once your cluster is ready, follow these steps -

  1. Head over to the Secrets tab in your project to start creating a secret

  2. When creating your secret, choose the environment required. On the Free Tier, the only env available is Development.

  1. Create an API key for Cosmocloud to connect to MongoDB Atlas.

    1. Open your MongoDB Atlas account.

    2. Click on Access Manager on the top of MongoDB Atlas page and select Project Access.

    3. Click on Create API Key on the left side.

    4. [Important] Name your key cosmocloud-apikey and give it Project Owner role.

    5. On the next step, copy your Private and Public keys and store them securely, to be used in Step 4.

  2. When creating a Database type Secret, Cosmocloud will ask you for these details -

    1. Database name: The name of the logical DB where your data would be stored.

    2. MongoDB Atlas Public Key: The public key you copied above.

    3. MongoDB Atlas Private Key: The private key you copied above.

    4. Project ID: Your MongoDB Atlas Project's ID. You can find this on your MongoDB Atlas project's settings page.

    5. Cluster name: The name of the Atlas Cluster you created (case sensitive, for eg. Cluster0)

After clicking on Create, it will take 30-45 seconds (on Free Tier) to establish a test connection with MongoDB, and a success message will be displayed. In case there’s an error in filling up the secrets, you will be notified about the same

You now have successfully connected your database!

You can start free by on your own and then connecting the same with Cosmocloud with below steps!

Next, you will be prompted to input your MongoDB cluster details. Then, Head over to, create a new Database Cluster, or use an existing one.

spinning up an M0 cluster
MongoDB Atlas account
MongoDB Atlas
Cosmocloud Support
Connecting your Database