Cursor.next()

NES2+Syntax

							cursor.next()

Description

The next() method of the Cursor object moves the point in the current row to the next row in the cursor. This method is used to iterate through each of the rows returned by the cursor. This method returns true, unless it is the last row of the cursor, at which time it returns false.

Example

Listing 8.34 creates an instance of the Cursor object and iterates through its results, deleting each row. This is performed by using the next() method.

Listing 8.34 Using the next() Method to Iterate Through the Rows in a Cursor
 <SERVER> var currRow = myConn.cursor('SELECT * FROM employees WHERE uid <= 200'); // Delete each row in the cursor. while(currRow.next(){ currRow.delete("employees"); } // ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.