Skip to content

Instantly share code, notes, and snippets.

View adityaparmar03's full-sized avatar
🎯
Focusing

Aditya Parmar adityaparmar03

🎯
Focusing
View GitHub Profile
Title:
#282828
Text:
#535353
Background:
#F5F5F5
#f2f2f2
Install HomeBrew First
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install MongoDB
brew update
brew install mongodb
mkdir -p /data/db
sudo mongod (Don't forgot sudo)
Prereq: Basic knowledge of HTML, CSS, Javascript
1. https://www.dashingd3js.com/table-of-contents
1. Download Mysql (DMG version) from https://dev.mysql.com/downloads/mysql/
2. Install the package and make sure to take snapshot of temporary password.
3. Open terminal.
4. Write cd /usr/local/mysql/bin
5. Go to System Preference and click on “mysql”. Check server is running or stopped. If the server is stopped, Please, start it.
6. Go to terminal and write ./mysql –u root –p (to login with temporary password)
7. After successful login, you can see mysql >
8. Please write SET PASSWORD FOR ‘root’ @ ‘localhost’ = PASSWORD(‘WRITE YOUR PASSWORD’);
So command is looks like mysql>SET PASSWORD FOR ‘root’@‘localhost’ = PASSWORD(‘WRITE YOUR PASSWORD’);
@adityaparmar03
adityaparmar03 / Connection Pooling in MongoDB with Node.js
Last active March 28, 2023 18:38
This is a code for connection pooling in mongoDB in NodeJS. In below code, MongoJS file establish connection and appJS file call MongoJS file for establishing connection. Then, Other routes use this same connection.
/* Mongo.js*/
var MongoClient = require('mongodb').MongoClient;
var url = "mongodb://localhost:27017/yourdatabasename";
var assert = require('assert');
var connection=[];
// Create the database connection
establishConnection = function(callback){
Primary Node:-
sudo nano /etc/fstab , change defaults with noatime.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo service mongod start
sudo service mongod stop
sudo nano /etc/hosts