Creating a MongoDB Replica Set Service

I’m trying to create a Service using a MongoDB Replica Set. MongoDB’s docs says here that the connection string format has to be


So, my connection string is something like


But when I try to explore the service, I’m not getting any data, collection or schema and I noticed that DreamFactory created another database called “DATABASE?replicaSet=REPLICA_SET_NAME”. I tried to just remove these options “replicaSet=REPLICA_SET_NAME” to see what happens and then I’m getting this error while I explore:

  "error": [
      "context": null,
      "message": "Failed to list resources for this service.\nIP1:PORT1: not master and slaveOk=false",
      "code": 500

If I keep trying to explore the same REST Endpoint (for instance, /rest/API-NAME?names_only=true&include_schemas=true), then I eventually get the correct response. It seems that it tries with a different ip and port every time I make the request.

I also noticed that if I just leave the primary server and remove the options from the connection string, then it works fine. But this is pointless, because I’m losing the whole replica set point.

I even tried to set a lookup key with the name “replicaSet” equals to REPLICA_SET_NAME, but it didn’t work either.

How can I use MongoDB replica sets with DreamFactory?

We have a replicaSet connection set up here, but are unsure how to confirm it’s properly implementing replication. In our case, we have the first host in the connection string. E.g., if the URI is


then the connection string in DSP is


This works for us and does not cause an error.