summaryrefslogtreecommitdiffstats
path: root/node_modules/mongoose/tools/repl.js
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
commite06ec920f7a5d784e674c4c4b4e6d1da3dc7391d (patch)
tree55713f725f77b44ebfec86e4eec3ce33e71458ca /node_modules/mongoose/tools/repl.js
downloadwebsite_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.gz
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.bz2
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.zip
api, login, auth
Diffstat (limited to 'node_modules/mongoose/tools/repl.js')
-rw-r--r--node_modules/mongoose/tools/repl.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/node_modules/mongoose/tools/repl.js b/node_modules/mongoose/tools/repl.js
new file mode 100644
index 0000000..8139a51
--- /dev/null
+++ b/node_modules/mongoose/tools/repl.js
@@ -0,0 +1,36 @@
+'use strict';
+
+const co = require('co');
+
+co(function*() {
+ const ReplSet = require('mongodb-topology-manager').ReplSet;
+
+ // Create new instance
+ const topology = new ReplSet('mongod', [{
+ // mongod process options
+ options: {
+ bind_ip: 'localhost', port: 31000, dbpath: `/data/db/31000`
+ }
+ }, {
+ // mongod process options
+ options: {
+ bind_ip: 'localhost', port: 31001, dbpath: `/data/db/31001`
+ }
+ }, {
+ // Type of node
+ arbiterOnly: true,
+ // mongod process options
+ options: {
+ bind_ip: 'localhost', port: 31002, dbpath: `/data/db/31002`
+ }
+ }], {
+ replSet: 'rs'
+ });
+
+ yield topology.start();
+
+ console.log('done');
+}).catch(error => {
+ console.error(error);
+ process.exit(-1);
+});