Home >Web Front-end >JS Tutorial >Prisma & MongoDB: server to be run as a replica set
Solution for: "Prisma needs to perform transactions, which requires your MongoDB server to be run as a replica set"
Service & controller have been created, everything should be safe.
However, when the API hits, Prisma needs to perform transactions, which requires your MongoDB server to be run as a replica set.
The error above only occurs in create, update, and delete operations,
because Prisma needs MongoDB running as replica set to perform those operations.
Make sure /etc/mongod.conf has the code below
replication: replSetName: rs0
Restart mongod service after config
changes
sudo systemctl restart mongod
https://abdulghofurme.github.io/posts/prisma-mongodb-server-to-be-run-as-a-replica-set/
The above is the detailed content of Prisma & MongoDB: server to be run as a replica set. For more information, please follow other related articles on the PHP Chinese website!