Class: Result

mapping~Result(rs, info, rowAdapter)

Represents the result of an execution as an iterable of objects in the Mapper.

Constructor

new Result(rs, info, rowAdapter)

Creates a new instance of Result.

Parameters:
Name Type Description
rs ResultSet
info ModelMappingInfo
rowAdapter function
Source:

Members

length :Number

Gets the amount of the documents contained in this Result instance.

When the results are paged, it returns the length of the current paged results not the total amount of rows in the table matching the query.

Type:
  • Number
Source:

pageState :String

A string token representing the current page state of query.

When provided, it can be used in the following executions to continue paging and retrieve the remained of the result for the query.

Type:
  • String
Default Value:
  • null
Source:

Methods

(generator) Symbol.iterator()

Returns a new Iterator object that contains the document values.

Source:

first()

Gets the first document in this result or null when the result is empty.

Source:

forEach(callback, thisArgopt)

Executes a provided function once per result element.

Parameters:
Name Type Attributes Description
callback function

Function to execute for each element, taking two arguments: currentValue and index.

thisArg Object <optional>

Value to use as this when executing callback.

Source:

toArray() → {Array.<Object>}

Converts the current instance to an Array of documents.

Source:
Returns:
Type
Array.<Object>

wasApplied()

When this instance is the result of a conditional update query, it returns whether it was successful. Otherwise, it returns true.

For consistency, this method always returns true for non-conditional queries (although there is no reason to call the method in that case). This is also the case for conditional DDL statements (CREATE KEYSPACE... IF NOT EXISTS, CREATE TABLE... IF NOT EXISTS), for which the server doesn't return information whether it was applied or not.

Source: