From 6b0176230470ee279aaf9ee5df8ffeb343016a68 Mon Sep 17 00:00:00 2001 From: Alan Plum Date: Wed, 30 Oct 2024 23:21:58 +0100 Subject: [PATCH] Expose cursor ID Fixes DE-936 --- CHANGELOG.md | 4 ++++ src/cursor.ts | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9d35383..afeafa66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,10 @@ This driver uses semantic versioning: These properties can be used to access the headers and path used when creating the route. +- Added `id` property to `ArrayCursor` and `BatchedArrayCursor` types (DE-936) + + This property can be used to access the ID of the cursor. + ## [9.1.0] - 2024-09-25 ### Changed diff --git a/src/cursor.ts b/src/cursor.ts index 385f768c..808bb823 100644 --- a/src/cursor.ts +++ b/src/cursor.ts @@ -233,6 +233,13 @@ export class BatchedArrayCursor { return this._db; } + /** + * ID of this cursor. + */ + get id() { + return this._id; + } + /** * An {@link ArrayCursor} providing item-wise access to the cursor result set. * @@ -783,6 +790,13 @@ export class ArrayCursor { return this._batches.database; } + /** + * ID of this cursor. + */ + get id() { + return this._batches.id; + } + /** * A {@link BatchedArrayCursor} providing batch-wise access to the cursor * result set.