2

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+)

TOPKAT
  • 6,667
  • 2
  • 44
  • 72
bavigim
  • 103
  • 1
  • 4
  • Right, standalones are not acceptable for transactions because they do not have an oplog. – D. SM Sep 09 '20 at 01:26
  • This can be helpful for you [https://stackoverflow.com/questions/51461952/mongodb-v4-0-transaction-mongoerror-transaction-numbers-are-only-allowed-on-a](https://stackoverflow.com/questions/51461952/mongodb-v4-0-transaction-mongoerror-transaction-numbers-are-only-allowed-on-a) – Muhammad Tariq Feb 11 '21 at 05:27

0 Answers0