#Bakcup/Restore Mongo db
Backup DB
mongodump -d <database_name> -o <directory_backup>
Restore DB
Create forder for db
mongorestore -d <database_name> <directory_backup>
ex:
mean-init\ChatServer>mongorestore -d demodb data/demodb
Server:
Install Mongo DB Server
Set 'up to bin' mongo db path
Run:
mongod --dbpath ""
For auth:
mongod --auth --dbpath ""
Client:
To start:
mongo
Some commands:
show dbs
show collections
show tables
use dbname
db.auth("username","password")
db.users.find().pretty()
db.user.find({"key":"value"}).pretty()
db.user.insert({"key":"value"})
Locate package.json in cmd prompt, and run "npm install"
node app.js
Run Index using any light weight web server
Socket works only in server