Transaction with mongoose (Transaction numbers are only allowed on a replica set member or mongos)

Viewed 3433

First, can someone please clarify this for me about replica set: does this mean I can't ran transactions on a single server(simply, without some VM etc) in production? Do I need to use run-rs for this? Please explain.

I ran the npm install run-rs -g and then run-rs -v 4.0.0, I've received a hanging response with Started replica set... and Connected to oplog. But when I try to send a request(in relevant endpoint) I receive an error: Transaction numbers are only allowed on a replica set member or mongos

I connect like so:

  .connect("mongodb://localhost/my-db-name", {
    useNewUrlParser: true,
    useUnifiedTopology: true,
    useFindAndModify: false,
  })

I use node with mongoose(5+)

0 Answers
Related