diff --git a/docs/site/Querying-data.md b/docs/site/Querying-data.md new file mode 100644 index 000000000000..c16dcc1583ee --- /dev/null +++ b/docs/site/Querying-data.md @@ -0,0 +1,11 @@ +--- +lang: en +title: 'Querying data' +keywords: LoopBack 4.0, LoopBack 4 +layout: readme +source: loopback-next +file: packages/metadata/README.md +sidebar: lb4_sidebar +permalink: /doc/en/lb4/Querying-data.html +summary: -- +--- diff --git a/docs/site/Working-with-data.md b/docs/site/Working-with-data.md new file mode 100644 index 000000000000..f98979893680 --- /dev/null +++ b/docs/site/Working-with-data.md @@ -0,0 +1,89 @@ +--- +lang: en +title: 'Working with data' +keywords: LoopBack 4.0, LoopBack 4 +layout: readme +source: loopback-next +file: packages/metadata/README.md +sidebar: lb4_sidebar +permalink: /doc/en/lb4/Working-with-data.html +summary: -- +--- + +In LoopBack 4, models describe the shape of data, repositories provide behavior +like CRUD operations, and controllers define routes (this is different from +LoopBack 3.x where models implement behavior too). LB4 +[repositories](Repository.md) provide a couple of create, read, update, and +delete (CRUD) operations. Once you have defined these three artifacts, you can +add data to the model, manipulate the data, and query it through these CRUD +operations. The following is an overview of CRUD operations at different levels: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OperationRESTLoopBack model method
(Node API)*
Corresponding SQL
Operation
Create + PUT /modelName +
POST /modelName +
create() +
createAll() +
INSERT
Read (Retrieve)GET /modelName?filter=...find*() + SELECT
Update (Modify) + POST /modelName +
PUT /modelName +
update*() +
replaceById() +
UPDATE
Delete (Destroy)DELETE /modelName/modelIDdelete*() + DELETE
+ +(\*) Methods listed are just prominent examples; other methods may provide +similar functionality; for example: `findById()`, `findOne()`, +and `updateAll()`.  See +[DefaultCrudRepository Methods API documentation](https://loopback.io/doc/en/lb4/apidocs.repository.defaultcrudrepository.html#methods) +for more information. + +See the following articles for more information: + +- [Creating, updating, and deleting data](Creating-updating-and-deleting-data.html) +- [Querying data](Querying-data.html) + - [Fields filter](Fields-filter.html) + - [Include filter](Include-filter.html) + - [Limit filter](Limit-filter.html) + - [Order filter](Order-filter.html) + - [Skip filter](Skip-filter.html) + - [Where filter](Where-filter.html) +- [Using database transactions](Using-database-transactions.html) +- [Realtime server-sent events](Realtime-server-sent-events.html) + +{% include content/angular-methods-caveat.html lang=page.lang %} diff --git a/docs/site/sidebars/lb4_sidebar.yml b/docs/site/sidebars/lb4_sidebar.yml index bef14ad761ef..824f24778bb1 100644 --- a/docs/site/sidebars/lb4_sidebar.yml +++ b/docs/site/sidebars/lb4_sidebar.yml @@ -539,6 +539,15 @@ children: url: Update-generator.html output: 'web, pdf' +- title: 'Working with data' + url: Working-with-data.html + output: 'web, pdf' + children: + + - title: 'Querying data' + url: Querying-data.html + output: 'web, pdf' + - title: 'Connectors reference' url: Connectors-reference.html output: 'web' @@ -860,3 +869,4 @@ children: - title: 'Considerations for GDPR readiness' url: Deploy-for-GDPR-readiness.html output: 'web, pdf' + \ No newline at end of file