79441456

Date: 2025-02-15 11:56:25
Score: 1
Natty:
Report link

According to the errmsg you have already run rs.initiate(). Your replicaset has already been initialized. You can check your current configuration using rs.config() in the mongoshell(i.e. mongos) or using db.getSiblingDB('local').system.replset.findOne()(as mentioned by @Stennie in the comments).

If you did not get { "ok" : 1 }, its because you did not give members in initiate arguments. Its no problem mongo took default configuration and created the current database into a replset primary.

If you were having a problem with pushing to database using prisma in local something like Prisma needs to perform transactions, which requires your MongoDB server to be run as a replica set. in mongosh local instance,it should be fixed now.

You can add members to your replicaset refer documentation.

Some resources I refered:

PS: I am also new to mongo. This is what I understood after my research.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Stennie
  • Low reputation (1):
Posted by: Mastermindsap