Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in addressing database name #153

Open
Adi9425 opened this issue Aug 7, 2024 · 3 comments
Open

error in addressing database name #153

Adi9425 opened this issue Aug 7, 2024 · 3 comments

Comments

@Adi9425
Copy link

Adi9425 commented Aug 7, 2024

src/db/index.js
in line 7 "${process.env.MONGODB_URI}/${DB_NAME})" , this " / " give error by connecting the database so just remove it and it would be life
"${process.env.MONGODB_URI}/${DB_NAME})" --> before
"${process.env.MONGODB_URI}${DB_NAME})" --> after

@lovishGIT
Copy link

use `` backticks instead of " or ' when u want ${} syntax in your string.

@SUJEET7488
Copy link

SUJEET7488 commented Aug 9, 2024

use template literals concept here
const connection= `${process.env.MONGODB_URL}${DB_NAME}`

@MadhurChaturvedi
Copy link

Or you can also do this

mongoos.connect(${process.env.MONGODB_URL}, {dbName:${DB_NAME}})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants