Skip to content

Commit

Permalink
[DOCS] Accept core changes (#91826)
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored Feb 18, 2021
1 parent 7503fd2 commit 3c0d73a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -50,7 +47,6 @@ const page2 = await savedObjectsClient.find({
pit: { id: page1.pit_id },
searchAfter: lastHit.sort,
});

await savedObjectsClient.closePointInTime(page2.pit_id);

```
Expand Down

0 comments on commit 3c0d73a

Please sign in to comment.