The acronym CRUD [kɹʌd] covers the four basic operations of persistent storage
- Create, create a record,
- Read or Retrieve, read a record,
- Update, update a record, and
- Delete or Destroy, delete a record.
These operations can be expressed using different terms depending on context or environment.
CRUD | MongoDB | SQL | HTTP Method | typical Rest URL (with HTTP Method) |
---|---|---|---|---|
Create | insertOne / insertMany |
INSERT |
POST | /todos |
Read or Retrieve | findOne / find |
SELECT |
GET | /todos/[todoId] (one), /todos (all) |
Update | updateOne / updateMany |
UPDATE |
PUT / PATCH | /todos/[todoId] |
Delete or Destroy | deleteOne / deleteMany |
DELETE |
DELETE | /todos/[todoId] |