If you’re trying to deploy part of a monorepo project, it sounds like you may need to set the “Root Directory” to blog_project_crud_operations_mongodb in the service settings.
Thank you! It is not showing the previous error but now it is showing this error: UnhandledPromiseRejectionWarning: MongoAPIError: URI must include hostname, domain name, and tld
However I used this as MONGODB_URI in environment variables mongodb+srv://myaccountname:@mydb.s3umjey.mongodb.net/?retryWrites=true&w=majority
The error shows it’s trying to connect to 127.0.0.1:27017 which is incorrect, you’ll need to ensure your code is reading from the environment variable.
I have added environment variable MONGODB_URI while deploying and this is the code of database.js. Can you please tell where the mistake can be and how can i ensure that my code is reading from the environment variable?