Class: DocumentStoreDocumentCursor
Cursor object that is used to retrieve documents one by one. If the cursor has reached an end, it becomes invalid. When a cursor is invalid the key field is set to zero, and the value field is set to nil. The value field can be nil if you have stored a nil document. Once the cursor reaches the end it can not be further used and can not be reset.
Methods
| Name | Description |
|---|---|
: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
| Name | Type | Description |
|---|---|---|
key | integer | An ID of the current document |
value | boolean|string|number|table|nil | A 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 DocumentStoreDocumentCursor:close() endMethod: next
Jumps to the next document and updates key and value fields
lua
function DocumentStoreDocumentCursor:next() endMethod: valid
Returns true if the cursor is valid and holds a valid document
lua
function DocumentStoreDocumentCursor:valid() endReturns:
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
