-
collections to represent group of items (instead of tables)
-
document-based which represents a single item (instead of row)
-
use Mongo Atlas since ultimately gonna use it.
- steps:
- build cluster
- create first db user
- add IP address (whitelist for all for simplicity)
- connect
- steps:
-
If deploying to heroku, IP address must be set to allow everywhere
-
Database > Collection > Document
-
MongoDB has dynamic schema, i.e. 2 documents in a collection don't necessarily share the same schema 😅 Therefore we should use Mongoose to create consistent schema.
-
PUT VS PATCH
-
PUT: replace the existing resource
-
PATCH: partial update
-
Don't set up one type of response or one route then go totally different in a different route, this can avoid confusion to user *
-
Always set PORT to process.env.PORT || 3000 to ease up deployment
jimbo23/express-task-manager
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published