Skip to content

Class: DocumentStoreIndexCursor

Cursor object that is used to retrieve documents one by one.

Methods

NameDescription
:close()Closes the cursor, should be done at the end.
:next()Jumps to the next document and updates key and value fields
:valid()Returns true if the cursor is valid and holds a valid document

Fields

NameTypeDescription
keyintegerAn ID of the current document
valueboolean|string|number|table|nilA value of the current document

Method declarations

Method: close

Closes the cursor, should be done at the end. The cursor will not be usable after it has been closed!

lua
function DocumentStoreIndexCursor:close() end

Method: next

Jumps to the next document and updates key and value fields

lua
function DocumentStoreIndexCursor:next() end

Method: valid

Returns true if the cursor is valid and holds a valid document

lua
function DocumentStoreIndexCursor:valid() end

Returns:

  • boolean - True if the cursor is valid

Field declarations

Field: key

An ID of the current document

Type: integer

Field: value

A value of the current document

Type: boolean|string|number|table|nil