12. API: SodaDocumentCursor Class
A SodaDocumentCursor is used to walk through a set of SODA documents
returned from a sodaCollection.find()
sodaOperation.getCursor()
method.
Note
In this release, SODA is only supported in the node-oracledb Thick mode. See Enabling node-oracledb Thick Mode.
12.1. SodaDocumentCursor Methods
- sodaDocumentCursor.close()
New in version 3.0.
Promise:
promise = close();
Closes a SodaDocumentCursor. It must be called when the cursor is no longer required. It releases resources in node-oracledb and Oracle Database.
Callback:
If you are using the callback programming style:
close(function(Error error){});
The parameters of the callback function
function(Error error)
are:Callback Function Parameter
Description
Error
error
If
close()
succeeds,error
is NULL. If an error occurs, thenerror
contains the error message.
- sodaDocumentCursor.getNext()
New in version 3.0.
Promise:
promise = getNext();
Returns the next SodaDocument in the cursor returned by a
find()
terminal method read operation.If there are no more documents, the returned
document
parameter will be undefined.Callback:
If you are using the callback programming style:
getNext(function(Error error, SodaDocument document){});
The parameters of the callback function
function(Error error, SodaDocument document)
are:Callback Function Parameter
Description
Error
error
If
getNext()
succeeds,error
is NULL. If an error occurs, thenerror
contains the error message.SodaDocument
document
The next document in the cursor. If there are no more documents, then
document
will be undefined.