mirror of
https://github.com/directus/directus.git
synced 2026-04-03 03:00:39 -04:00
Remove reference to readByQuery (#11188)
Updated order of examples and aligned titles to match Added missing updateOne example
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user