[DOCS] Accept core changes (#91826)
This commit is contained in:
parent
7503fd256a
commit
3c0d73af8b
2 changed files with 5 additions and 9 deletions
|
@ -25,7 +25,7 @@ const page1 = await savedObjectsClient.find({
|
|||
type: 'visualization',
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'asc',
|
||||
pit,
|
||||
pit: { id },
|
||||
});
|
||||
const lastHit = page1.saved_objects[page1.saved_objects.length - 1];
|
||||
const page2 = await savedObjectsClient.find({
|
||||
|
|
|
@ -29,19 +29,16 @@ openPointInTimeForType(type: string | string[], { keepAlive, preference }?: Save
|
|||
|
||||
|
||||
```ts
|
||||
const repository = coreStart.savedObjects.createInternalRepository();
|
||||
|
||||
const { id } = await repository.openPointInTimeForType(
|
||||
type: 'index-pattern',
|
||||
{ keepAlive: '2m' },
|
||||
const { id } = await savedObjectsClient.openPointInTimeForType(
|
||||
type: 'visualization',
|
||||
{ keepAlive: '5m' },
|
||||
);
|
||||
const page1 = await savedObjectsClient.find({
|
||||
type: 'visualization',
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'asc',
|
||||
pit,
|
||||
pit: { id, keepAlive: '2m' },
|
||||
});
|
||||
|
||||
const lastHit = page1.saved_objects[page1.saved_objects.length - 1];
|
||||
const page2 = await savedObjectsClient.find({
|
||||
type: 'visualization',
|
||||
|
@ -50,7 +47,6 @@ const page2 = await savedObjectsClient.find({
|
|||
pit: { id: page1.pit_id },
|
||||
searchAfter: lastHit.sort,
|
||||
});
|
||||
|
||||
await savedObjectsClient.closePointInTime(page2.pit_id);
|
||||
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue