Cursor.return()
The content in this help topic pertains to SuiteScript 2.1.
|
Method Description |
Closes the cursor and ends iteration. After you call this method, subsequent |
|
Returns |
Promise Object. Resolves to a completed iterator result. For information about the iterator result's properties, see Using the next() Method. |
|
Supported Script Types |
Server scripts |
|
Governance |
None |
|
Module |
|
|
Parent Object |
|
|
Sibling Object Members |
|
|
Since |
2026.2 |
Parameters
None.
Errors
None.
Syntax
The following code sample shows the syntax for this member. It isn't a functional example. For a complete script example, see N/dataStore Module Script Samples.
// Add additional code
...
const cursor = await collection.find({ status: 'pending' });
const first = await cursor.next();
await cursor.return();
...
// Add additional code