ScyllaDB University Live | Free Virtual Training Event
Learn more
ScyllaDB Documentation Logo Documentation
  • Deployments
    • Cloud
    • Server
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
    • Supported Driver Versions
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Install
Search Ask AI
ScyllaDB Docs ScyllaDB Node.js Driver API Reference Modules types ResultSet

ResultSet¶

types~ResultSet(result, encoder, pagingStateopt)

Represents the result of a query.

Constructor¶

new ResultSet(result, encoder, pagingStateopt)

Parameters:
Name Type Attributes Description
result rust.QueryResultWrapper
encoder _Encoder
pagingState rust.PagingStateResponseWrapper <optional>

Source

types/result-set.js, line 19

Members¶

(readonly) columns :Array:.<{String:, type:}>

Gets the columns returned in this ResultSet.

Type:
  • Array:.<{String:, type:}>

Source

types/result-set.js, line 135

(readonly) info :Object

Information on the execution of a successful query:

Type:
  • Object
Properties:
Name Type Description
achievedConsistency Number

The consistency level that has been actually achieved by the query.

queriedHost String

The Cassandra host that coordinated this query.

triedHosts Object

Gets the associative array of host that were queried before getting a valid response, being the last host the one that replied correctly.

speculativeExecutions Object

The number of speculative executions (not including the first) executed before getting a valid response.

traceId Uuid

Identifier of the trace session.

warnings Array:.<string:>

Warning messages generated by the server when executing the query.

isSchemaInAgreement Boolean

Whether the cluster had reached schema agreement after the execution of this query.

TODO: Check if this is the case in rust driver:

After a successful schema-altering query (ex: creating a table), the driver will check if the cluster's nodes agree on the new schema version. If not, it will keep retrying for a given delay (see protocolOptions.maxSchemaAgreementWaitSeconds).

Note that the schema agreement check is only performed for schema-altering queries For other query types, this method will always return true. If this method returns false, clients can call Metadata.checkSchemaAgreement() later to perform the check manually.

Source

types/result-set.js, line 172

nextPage :function

Method used to manually fetch the next page of results. This method is only exposed when using the Client#eachRow method and there are more rows available in following pages.

Type:
  • function

Source

types/result-set.js, line 121

pageState :String|null

A string token representing the current page state of query. It can be used in the following executions to continue paging and retrieve the remained of the result for the query.

Type:
  • String | null
Default Value:
  • null

Source

types/result-set.js, line 104

(package) rawNextPageAsync

Internal method to get the next page asynchronously, without wrapping into a ResultSet.

Source

types/result-set.js, line 127

rowLength :Number|undefined

Gets the row length of the result, regardless if the result has been buffered or not

Type:
  • Number | undefined

Source

types/result-set.js, line 92

rows :Array:.<Row:>|undefined

Gets an array rows returned by the query. When the result set represents a response from a write query, this property will be undefined. When the read query result contains more rows than the fetch size (5000), this property will only contain the first rows up to fetch size. To obtain all the rows, you can use the built-in async iterator that will retrieve the following pages of results.

Type:
  • Array:.<Row:> | undefined

Source

types/result-set.js, line 86

Methods¶

@@asyncIterator() → {AsyncIterator:.<Row:>}

Gets the async iterator function.

Retrieves the async iterator representing the entire query result, the driver will fetch the following result pages.

Use the async iterator when the query result might contain more rows than the fetchSize.

Note that using the async iterator will not affect the internal state of the ResultSet instance. You should avoid using both rows property that contains the row instances of the first page of results, and the async iterator, that will yield all the rows in the result regardless on the number of pages.

Multiple concurrent async iterations are not supported.

Source

types/result-set.js, line 268

Returns:
Type
AsyncIterator:.<Row:>
Example

Using for await...of statement

const query = 'SELECT user_id, post_id, content FROM timeline WHERE user_id = ?';
const result = await client.execute(query, [ id ], { prepare: true });
for await (const row of result) {
  console.log(row['email']);
}

@@iterator() → {Iterator:.<Row:>}

Gets the iterator function.

Retrieves the iterator of the underlying fetched rows, without causing the driver to fetch the following result pages. For more information on result paging, visit the documentation.

See:
  • module:types~ResultSet#@@asyncIterator

Source

types/result-set.js, line 239

Returns:
Type
Iterator:.<Row:>
Example

Using for...of statement

const query = 'SELECT user_id, post_id, content FROM timeline WHERE user_id = ?';
const result = await client.execute(query, [ id ], { prepare: true });
for (const row of result) {
  console.log(row['email']);
}

first()

Returns the first row or null if the result rows are empty.

Source

types/result-set.js, line 198

isPaged() → {boolean}

Determines whether there are more pages of results. If so, the driver will initially retrieve and contain only the first page of results. To obtain all the rows, use the AsyncIterator.

Source

types/result-set.js, line 318

Returns:
Type
boolean

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

types/result-set.js, line 214

Was this page helpful?

PREVIOUS
Long
NEXT
ResultStream
  • Create an issue
  • Edit this page

On this page

  • ResultSet
    • Constructor
    • Members
    • Methods
ScyllaDB Node.js Driver
Search Ask AI
  • main
    • main
  • API Reference
    • Modules
      • auth
        • AuthProvider
        • Authenticator
        • PlainTextAuthProvider
      • concurrent
      • datastax
      • errors
        • ArgumentError
        • AuthenticationError
        • BusyConnectionError
        • DriverInternalError
        • NoHostAvailableError
        • NotSupportedError
        • OperationTimedOutError
        • ResponseError
      • geometry
      • mapping
        • DefaultTableMappings
        • Mapper
        • ModelBatchItem
        • ModelMapper
        • Result
        • UnderscoreCqlToCamelCaseMappings
        • TableMappings
      • metadata
        • Aggregate
        • ClientState
        • ColumnMetadata
        • Index
        • KeyspaceMetadata
        • MaterializedView
        • Metadata
        • SchemaFunction
        • Strategy
        • TableMetadata
        • UdtField
        • UserDefinedType
      • metrics
        • DefaultMetrics
        • ClientMetrics
      • policies
        • addressResolution
          • AddressTranslator
          • EC2MultiRegionTranslator
          • MappingAddressTranslator
        • loadBalancing
          • AllowListPolicy
          • DCAwareRoundRobinPolicy
          • DefaultLoadBalancingPolicy
          • LegacyDefaultLoadBalancingPolicy
          • LoadBalancingConfig
          • LoadBalancingPolicy
          • RoundRobinPolicy
          • TokenAwarePolicy
        • reconnection
          • ConstantReconnectionPolicy
          • ExponentialReconnectionPolicy
          • ReconnectionPolicy
        • retry
          • FallthroughRetryPolicy
          • RetryPolicy
        • speculativeExecution
          • ConstantSpeculativeExecutionPolicy
          • NoSpeculativeExecutionPolicy
          • SpeculativeExecutionPolicy
        • timestampGeneration
          • MonotonicTimestampGenerator
          • TimestampGenerator
      • tracker
        • RequestLogger
        • RequestTracker
      • types
        • Duration
        • InetAddress
        • Integer
        • LocalDate
        • Long
        • ResultSet
        • ResultStream
        • Row
        • TimeUuid
        • Vector
    • Classes
      • AddressResolver
      • ByteOrderedToken
      • Client
      • Encoder
      • EncoderMembers
      • ExecutionOptions
      • ExecutionProfile
      • FrameReader
      • HashSet
      • Host
      • HostMap
      • LineString
      • Murmur3Token
      • Point
      • Polygon
      • PreparedInfo
      • RandomToken
      • SslOptions
      • Token
      • TokenRange
    • Interfaces
    • Events
    • Global Functions and Constants
Docs Tutorials University Contact Us About Us
© 2026 ScyllaDB | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 14 May 2026.
Powered by Sphinx 9.1.0 & ScyllaDB Theme 1.9.2