I am not able to connect mongoDB with my next js project

heyakhilHOBBY

3 months ago

I am building a project in next js and I am not able to connect with it
I think is issue is due to te prisma i am using in my project that's why i am getting this error

Error in creating user with email {

'Invalid prisma.login.deleteMany() invocation:\n' +

'Prisma needs to perform transactions, which requires your MongoDB server to be run as a replica set. https://pris.ly/d/mongodb-replica-set';

}

Awaiting User Response

3 Replies

3 months ago

The error suggests you need to configure your MongoDB server as a replica set to use it with Prisma, rather than as a single instance. You can find a Railway Template for a High-Availability MongoDB template with replica sets here.


Status changed to Awaiting User Response railway[bot] 3 months ago


heyakhilHOBBY

3 months ago

Please check the attachment i have created replica set but still i am getting this error and also i don't know why it is showing "paused from exceeding limit".

Attachments


Status changed to Awaiting Railway Response railway[bot] 3 months ago


3 months ago

paused from exceeding limit

This happens if you had a Hard Usage Limit configured on your account. In that case, if your limit is reached, your resources are stopped.

Please check the attachment i have created replica set

Per your screenshot, you only have a single instance of MongoDB, and it can therefor not be configured as a replica set. Please take a look at the template I linked above. If you are not set on using MangoDB with Prisma, you can also consider using another database service that doesn't require replicas, such as PostgreSQL. There's a starter template for Prisma with PostgreSQL available here for inspiration.


Status changed to Awaiting User Response railway[bot] 3 months ago


I am not able to connect mongoDB with my next js project - Railway Help Station