projects/Qwestly/qwestly-database.md

Qwestly/qwestly-database.md

Dedicated Cluster - Cluster2

MongoDB Local

MONGODB_USER=qwestly
MONGODB_PASS=pAYmEGw9XaAp7mPqktKi
MONGODB_HOST=mongodb.dph.am
MONGODB_DATABASE=clearfit

Shell

# Shell
mongosh "mongodb+srv://cluster0.k4hyh.mongodb.net/" --apiVersion 1 --username dominick --password embNxk9he3klfY0C --authenticationDatabase admin

# Compass
mongodb+srv://dominick:embNxk9he3klfY0C@cluster0.k4hyh.mongodb.net/

# dump & restore
mongodump --uri="mongodb://dominick:152434Dd@mongo.dph.am/?authSource=admin" --db=clearfit --out=./db 
mongorestore --uri="mongodb+srv://dominick:embNxk9he3klfY0C@cluster0.k4hyh.mongodb.net/?authSource=admin" --db=qwestly ./db/clearfit

# grant access to user
mongosh -u "dominick" -p "152434Dd" --authenticationDatabase "admin" mongodb://z.dph.am:27017
use admin
db.grantRolesToUser("qwestly", [{ role: "readWrite", db: "qwestly" }])