From 80253cabf82ad6524aef9b901d118932fc95363f Mon Sep 17 00:00:00 2001 From: Pierre THIERRY Date: Sat, 5 Sep 2020 16:30:41 +0200 Subject: [PATCH] Add mongo init database script. --- src/mongodb/initDatabase.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/mongodb/initDatabase.js diff --git a/src/mongodb/initDatabase.js b/src/mongodb/initDatabase.js new file mode 100644 index 0000000..1675e61 --- /dev/null +++ b/src/mongodb/initDatabase.js @@ -0,0 +1,14 @@ +use express-test; + +db.collection.test.insert({id: 'test'}); + +db.createUser( + { + user: "express-user", + pwd: "P@ssword1", + roles: + [ + { role: "readWrite", db: "express-test" } + ] + } +) \ No newline at end of file