Skip to content

Commit f7b20bd

Browse files
Merge remote-tracking branch 'origin/main'
2 parents a0b9a5c + 1780a28 commit f7b20bd

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

docs/build/datastore.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ const myList = await listDocs({
222222
});
223223
```
224224

225-
The function accepts various optional parameters, including a matcher (a regex applied to the document keys and descriptions), pagination options, and sorting order.
225+
The function **accepts various optional parameters**, including a matcher (a regex applied to the document keys and descriptions), pagination options, and sorting order.
226226

227227
```javascript
228228
import { listDocs } from "@junobuild/core";
@@ -246,6 +246,18 @@ Sorting can be applied descending or ascending to following fields:
246246

247247
Options `matcher`, `paginate` and `order` can be use together.
248248

249+
The function **returns various information**, in the form of an object whose interface is given below.
250+
251+
```typescript
252+
{
253+
items: []; // The data - array of documents
254+
items_length: bigint; // The number of documents - basically items.length
255+
items_page?: bigint; // If the query is paginated, at what page (starting from 0) do the items find the place
256+
matches_length: bigint; // The total number of matching results
257+
matches_pages?: bigint; // If the query is paginated, the total number (starting from 0) of pages
258+
}
259+
```
260+
249261
## Delete a document
250262

251263
To delete a document, use the `deleteDoc` function, which also performs timestamp validation to ensure that the most recent document is being deleted:

docs/build/storage.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ The `listAssets` function -- in addition to specifying the collection to query -
135135
- `paginate`: an object used to query a subset of the assets
136136
- `order`: requests entries sorted in ascending or descending order
137137

138+
The function **returns various information**, in the form of an object whose interface is given below.
139+
140+
```typescript
141+
{
142+
items: []; // The data - array of assets
143+
items_length: bigint; // The number of assets - basically items.length
144+
items_page?: bigint; // If the query is paginated, at what page (starting from 0) do the items find the place
145+
matches_length: bigint; // The total number of matching results
146+
matches_pages?: bigint; // If the query is paginated, the total number (starting from 0) of pages
147+
}
148+
```
149+
138150
## Delete asset
139151

140152
To delete an asset, you only need to provide its `fullPath`. Unlike the [datastore](datastore.md), there is no timestamp validation performed when deleting an asset.

0 commit comments

Comments
 (0)