Skip to content

Developer freindly Doc for solving Error when running prisma+mongodb with connection string with no database name #5562

@Osmanity

Description

@Osmanity

Bug description

HI, Im integrating prisma & mongodb and got a problem when following the documentation here, for more developer friendly experience doc, it would be helpful to update it, see the image included for how

How to reproduce

  1. Go to Doc guide for set up prisma + mognodb, here
  2. Follow the step-by-step guide for integrating Prisma into your project.
  3. Start by creating a basic database cluster on MongoDB.
  4. Access the Atlas dashboard for MongoDB management.
  5. Navigate to the 'Database' tab.
  6. Establish a connection to the database using the provided drivers.
  7. Incorporate the database connection string into your application's code.
  8. prisma_doc Note that MongoDB Atlas generates an environment link which, crucially, lacks the database name. generate env link without the Database name
  9. Commonly, users copy the provided MongoDB environment key directly into their project's .env file, assuming it is complete.
  10. The error message displayed is: "
Error: 
Invalid prisma.blog.findMany() invocation: Raw query failed. Code: unknown. Message: Kind: Command failed: Error code 8000 (AtlasError): empty database name not allowed.

Expected behavior

To enhance the developer-friendly aspect of prisma documentation, it would be beneficial to add a concise, highlighted notice, perhaps with an exclamation mark, advising developers to include the database name when copying the environment variable for the MongoDB URL link. This addition would significantly improve the clarity and usability of prisma documentation, see image for where the information could be placed:
prisma_doc_2

Prisma information

datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}

generator client {
provider = "prisma-client-js"
}
...

Environment & setup

  • OS: Windows, win32, x64
  • Database: MongoDB
  • Node.js version: v18.18.2

Prisma Version

Prsima: 5.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/docsDocumentation creation, updates or corrections

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions