How to create replica set of mongodb in ubuntu and enable it?

I am using MongoDB community edition in Ubuntu 22.04. How can I make replica set in my local machine and how can I enable it to use in my node js application?

1 Like