Skip to content

Commit

Permalink
fix: Better structure
Browse files Browse the repository at this point in the history
  • Loading branch information
taorepoara committed Feb 28, 2023
1 parent 30a67b9 commit 5898dab
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/markdown/features/data-management.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
Lenra Data system is based on Mongo, we provide API to manage these data.
You can access these data througt the API or in Application using the View component
Lenra Data system is based on Mongo.
We provide API to manage these data and you can access them in to adapt your app interface by using the [View component](/references/components-api/components/view.html).

## API

to call our API in Listeners you can used api object passed in third parameter, that provide you the server url and your token.
In order to manage the data in your app, you can call our REST API.
To handle the basic call to our API in Listeners you can used api object passed in third parameter, that provide you the server url and your token.

### CRUD

Get a specific document
```js
- GET `${api.url}/app/colls/${coll}/docs/${id}`
```
Create a document, give the content in body

```js
- POST `${api.url}/app/colls/${coll}/docs`
```

Read a specific document
```js
- GET `${api.url}/app/colls/${coll}/docs/${id}`
```

Update a document, give the change in body
```js
- PUT `${api.url}/app/colls/${coll}/docs/${doc._id}`
Expand All @@ -24,6 +29,8 @@ Delete a document
- DELETE `${api.url}/app/colls/${coll}/docs/${doc._id}`
```

### Advanced Mongo functions

Run find request, give find params in body like:
- query: the query
- projection: the projection map more details [here](#apiProjection)
Expand Down

0 comments on commit 5898dab

Please sign in to comment.