This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### LOGIN | |
GET : /api/login => Load UI login page | |
POST : /api/login => auth login with email & password | |
### TRANSACTION | |
GET : /api/transactions/:page => Load UI home transaction page | |
GET : /api/transactions/create => Load UI create transaction page | |
PUT : /api/transactions/create => add new transaction | |
PATCH : /api/transactions/isComplete/:id => complete transaction | |
### USER | |
GET : /api/users/ => Load UI home user page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Create new account in Mongo Atlas | |
### New Cluster | |
### Databases Access : New User and role user | |
### Network Access : Add ip | |
### Connect with appNodeJS using mongoose: | |
const mongoose = require('mongoose'); | |
const url = "mongodb+srv://<username>:<password>@<nameCluster>-ie3x8.gcp.mongodb.net/<DBname>?retryWrites=true&w=majority" | |
mongoose.connect(url, {useNewUrlParser: true, useUnifiedTopology: true}); | |
...Using... | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Colection == table; document == row/tuble; field == column | |
-> Connect DB | |
### - Show DB : show dbs - dont show empty DB. | |
### - use or create DB : use <DB-name> | |
### - Check DB using : db | |
### - insert collection : db.<coll-name>.insert({"name" :"xyz"}) | |
db.createCollection("name-Coll", {option}) - option : capped, autoIndexId, size, max. | |
### - show Collection : show collections | |
### - Drop DB (default "test" DB) : db.dropDatabase() | |
### - Drop Collection : db.<coll-name>.drop() |