Remove reference to readByQuery (#11188)

Updated order of examples and aligned titles to match
Added missing updateOne example
This commit is contained in:
Brainslug
2022-01-20 21:24:40 +01:00
committed by GitHub
parent 75b5f33727
commit 595eb696ea

View File

@@ -478,16 +478,24 @@ await articles.createMany([
]);
```
### Read All
### Read Single Item
```js
await articles.readMany();
await articles.readOne(15);
```
### Read By Query
Supports optional query:
```js
await articles.readByQuery({
await articles.readOne(15, {
fields: ['title'],
});
```
### Read Multiple Items
```js
await articles.readMany({
search: 'Directus',
filter: {
date_published: {
@@ -497,16 +505,32 @@ await articles.readByQuery({
});
```
### Read By Primary Key(s)
```js
await articles.readMany({
limit: -1,
});
```
### Update Single Item
```js
await articles.readOne(15);
await articles.updateOne(15, {
title: 'This articles now has a different title',
});
```
Supports optional query:
```js
await articles.readOne(15, { fields: ['title'] });
await articles.updateOne(
42,
{
title: 'This articles now has a similar title',
},
{
fields: ['title'],
}
);
```
### Update Multiple Items