BUCKET.CURSORS
Lists all active cursors for the current session.
Syntax
Section titled “Syntax”BUCKET.CURSORS [operation]Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
operation | string | No | Filter cursors by operation type. Must be QUERY, DELETE, or UPDATE (case-insensitive). If omitted, returns cursors for all operation types. |
Return Value
Section titled “Return Value”Returns a mapping of cursor IDs to their query filters for each operation type. Query filters are serialized as JSON regardless of the original format used when creating the cursor.
RESP3 (map format):
Without operation filter:
> BUCKET.CURSORS1# "QUERY" => 1# (integer) 2 => {}2# "UPDATE" => 1# (integer) 1 => {"name": "Henry"}3# "DELETE" => (empty map)With operation filter (e.g., BUCKET.CURSORS UPDATE):
> BUCKET.CURSORS UPDATE1# "UPDATE" => 1# (integer) 1 => {"name": "Henry"}RESP2 (array format):
Without operation filter:
> BUCKET.CURSORS1) "QUERY"2) 1) (integer) 2 2) {}3) "UPDATE"4) 1) (integer) 1 2) {"name": "Henry"}5) "DELETE"6) (empty array)With operation filter:
> BUCKET.CURSORS UPDATE1) "UPDATE"2) 1) (integer) 1 2) {"name": "Henry"}When no cursors exist for an operation type, the corresponding map or array is empty.
Errors
Section titled “Errors”Argument errors:
| Error Code | Error message | Cause |
|---|---|---|
ERR | Unknown '<operation>' operation | The operation type is not QUERY, DELETE, or UPDATE. |
Examples
Section titled “Examples”List all cursors:
> BUCKET.QUERY users '{"age": {"$gt": 20}}' BATCH 101# "cursor_id" => (integer) 12# "entries" => ... (first 10 documents)
> BUCKET.UPDATE users '{"status": "pending"}' '{"$set": {"status": "active"}}' BATCH 51# "cursor_id" => (integer) 22# "object_ids" => ... (first 5 object ids)
> BUCKET.CURSORS1# "QUERY" => 1# (integer) 1 => "{"age": {"$gt": 20}}"2# "UPDATE" => 1# (integer) 2 => "{"status": "pending"}"3# "DELETE" => (empty map)List only query cursors:
> BUCKET.CURSORS QUERY1# "QUERY" => 1# (integer) 1 => "{"age": {"$gt": 20}}"List cursors when none exist:
> BUCKET.CURSORS1# "QUERY" => (empty map)2# "UPDATE" => (empty map)3# "DELETE" => (empty map)Verify cursor removal after close:
> BUCKET.QUERY users '{}' BATCH 101# "cursor_id" => (integer) 12# "entries" => ... (documents)
> BUCKET.CURSORS QUERY1# "QUERY" => 1# (integer) 1 => {}
> BUCKET.CLOSE QUERY 1OK
> BUCKET.CURSORS QUERY1# "QUERY" => (empty map)