Database Schema - Shanfang/SmartNote GitHub Wiki
DATABASE Address: mongodb://localhost:27017/microDev
.
Listening Port: 3002
.
Global Element | Description | Type |
---|---|---|
user_name | User who owns the note | String |
title | Title of the note | String |
content | Content of the note | String |
tag | Tag of the note | Array |
date | Date when note is saved | Date |
sourceLink | URL where the note is generated from | String |
id | ID of the note | ObjectId |
-
Install MongoDB: run commands
brew update
andbrew install mongodb
. -
First Time Setting Up: run
mkdir -p /data/db
to create a folder in the default location where the Mongo data files will be stored. -
Permission Setting: run
sudo chown -R `id -un` /data/db
to make sure that the /data/db directory has the right permissions. -
Start Database: run
mongod
in the terminal to start the Mongo daemon, this step starts the Mongo serever. - Exit mongo service:
- To exit the Mongo shell run
quit()
. - To quit the Mongo daemon, press Ctrl + C.
- Go to folder server by
cd server/
and runnpm install
andnpm run dev
. - Terminal shows successful connection info.
Listening port3002
Environment variablesundefined
mongodb://localhost:27017/microDev sucessfully connected