Replica set mode

Present the cluster as a replica set to applications that connect with replicaSet=.

By default every node presents itself to drivers as a mongos. If an application or tool expects a replica set (it connects with replicaSet=, reads the oplog or uses the replSet* commands), change the presentation live, without restarting any node:

Shell
teseladb admin topology set replicaset --name rs0

Or from mongosh, with the topologyPresentation cluster parameter.

What drivers see

The designated node answers hello as primary and the others as secondaries, with setName, hosts, primary and electionId. If the designated node stops being alive, the cluster designates another with no intervention and drivers see it as a MongoDB election.

mongodb://node-01:27017,node-02:27017,node-03:27017/?replicaSet=rs0&tls=true

Oplog

local.oplog.rs is a read-only collection generated from the versions of the documents. Tools that read the oplog and mongodump --oplog work in both modes, and applyOps applies entries as in MongoDB.