May I use transaction in an stand alone win server with node?

Hi there, It´s my first time here …
I use one lab to learn and I need to use transactions to insert data in 2 diferent collections, but since yesterday I´m trying and this error message pops in my screen … “Transaction numbers are only allowed on a replica set member or mongos”. I already tryed the node university video and copy the code with my data, and all others internet sources, but i have no success.
I am using an stand alone windows with node (all updated). Is it possible to use transactions in my environment? how ?
ps- I tryed to set up the replication in cfg file, but when I do it the mongo service does not run anymore. ( I also set up the security: authorization enable)

Post the Config File? I got some time to kill if you’d like me to look at it.

1 Like


for documentation of all options, see:

Where and how to store data.

dbPath: C:\Program Files\MongoDB\Server\6.0\data
enabled: true



where to write logging data.

destination: file
logAppend: true
path: C:\Program Files\MongoDB\Server\6.0\log\mongod.log

network interfaces

port: 27017


authorization: enabled




Enterprise-Only Options:




So it looks like you’re trying to do this for a standalone instance, so do the following:

  • Stop the service.

  • Build a new config file like this (add more fields but this is the minimum you have to have):
    destination: file
    path: “mongod.log”
    dbPath: “M:\data\db”
    replSetName: “replicaSetName”

  • Start it with the config file.

mongod --config "M:\path\mongod.cfg"

  • Turn on the replica set
> rs.initiate()

  • Check Replica State
> rs.status()

Let me know if this works out for you.


@Gustavo_Castro We want to build this with the bare minimum we need, so that way we can narrow down where the configuration is failing.

This is a bit surprising to me. I thought transactions are also available in a standalone node.
Just use a single node replica set for it.