Cursor.next()
The content in this help topic pertains to SuiteScript 2.1.
|
Method Description |
Returns the next iterator result. This method retrieves additional results as needed. If you call |
|
Returns |
Promise Object. Resolves to an iterator result. When a result is available, its For information about the iterator result's properties, see Using the next() Method. |
|
Supported Script Types |
Server scripts |
|
Governance |
10 units for each retrieval request. No units for calls that don't require a retrieval request. |
|
Module |
|
|
Parent Object |
|
|
Sibling Object Members |
|
|
Since |
2026.2 |
Parameters
None.
Errors
|
Error Code |
Error Message |
Thrown If |
|---|---|---|
|
|
The |
Data Store is disabled for the account. |
|
|
The |
The executing script belongs to a bundle. |
|
|
Data Store inputs must not contain circular references. |
The query contains a circular reference when retrieving additional results. |
|
|
Use |
A query uses an unsupported logical operator. |
|
|
Field operator objects must contain at least one operator. |
A field-operator object is empty. |
|
|
Use a number or string with ordering comparison operators. |
An ordering comparison uses an incompatible operand. |
|
|
The field operator or direct object comparison isn't supported. Use a supported operator or compare individual object properties. |
A query uses an unsupported field operator or directly compares an object. |
|
|
|
The |
|
|
Nested |
The query nests |
|
|
Field paths are limited to 32 segments and 256 UTF-8 bytes. |
A complete query path exceeds either limit. |
|
|
Use nonempty object property names in field paths. Array indexes and JSONPath syntax aren't supported. |
A field path contains unsupported syntax. |
|
|
Query string literals are limited to 4,000 UTF-8 bytes. |
A string operand exceeds the byte limit. |
|
|
Query numbers must be finite. |
A numeric query operand is nonfinite. |
|
|
Use JSON scalar values for comparisons. Objects and arrays can't be compared directly. |
A direct comparison uses a nonscalar value. |
|
|
A query predicate must be a JSON object. |
A query predicate is not an object. |
|
|
Query object keys must be strings. |
A query object has a nonstring key. |
|
|
Logical and membership operators require nonempty arrays. |
A logical or membership operand is empty or is not an array. |
|
|
The operation requires too many bound parameters. Simplify the query or reduce the batch size. |
The operation requires more than 32,000 bound parameters, including internal parameters. |
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 nextResult = await cursor.next();
if (!nextResult.done) {
log.debug({ title: 'Document', details: nextResult.value.document });
}
...
// Add additional code