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: + +
Operation | +REST | +LoopBack 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/modelID | +delete*()
+ |
+ DELETE | +