Skip to content

Instantly share code, notes, and snippets.

@codejayant
Last active November 26, 2017 02:46
Show Gist options
  • Select an option

  • Save codejayant/a817a58156933f87ac15207ea1041f86 to your computer and use it in GitHub Desktop.

Select an option

Save codejayant/a817a58156933f87ac15207ea1041f86 to your computer and use it in GitHub Desktop.
MongoDB Notes

To start Mongo from mongo/bin folder execute this command
~/mongo/bin/mongod --dbpath ~/mongo-data/
where mongo-data is a folder in user directory.

To start mongo at terminal ./mongo

Mongo GUI : robomongo or robo 3T

NoSQL Vocab:
Table === Collection
Row === Document
Column === Field

npm install mongodb --save

mongo create database only when data is inserted.

Mongoose

ORM for MongoDB
npm install mongoose --save

HEROKU Section :

1. heroku create
2. heroku addons:create mongolab:sandbox
3. heroku config
4. git push heroku master
5. heroku logs

Mongoose Middleware

http://mongoosejs.com/docs/middleware.html

Setting config

1. heroku config
2. heroku config:set NAME=jayant
3. heroku config:get NAME
4. heroku config:unset NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment