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
Ask AI
ScyllaDB Docs ScyllaDB CPP RS Driver API Documentation CassCollection

Caution

You're viewing documentation for an unstable version of ScyllaDB CPP RS Driver. Switch to the latest stable version.

CassCollection¶

struct CassCollection¶

A collection of values.

Public Types

enum CassCollectionType¶

Values:

Public Functions

CassCollection *cass_collection_new(CassCollectionType type, size_t item_count)¶

Creates a new collection.

See also

cass_collection_free()

Parameters:
  • type – [in]

  • item_count – [in] The approximate number of items in the collection.

Returns:

Returns a collection that must be freed.

CassCollection *cass_collection_new_from_data_type(const CassDataType *data_type, size_t item_count)¶

Creates a new collection from an existing data type.

See also

cass_collection_free();

Parameters:
  • data_type – [in]

  • item_count – [in] The approximate number of items in the collection.

Returns:

Returns a collection that must be freed.

void cass_collection_free(CassCollection *collection)¶

Frees a collection instance.

Parameters:

collection – [in]

const CassDataType *cass_collection_data_type(const CassCollection *collection)¶

Gets the data type of a collection.

Parameters:

collection – [in]

Returns:

Returns a reference to the data type of the collection. Do not free this reference as it is bound to the lifetime of the collection.

CassError cass_collection_append_int8(CassCollection *collection, cass_int8_t value)¶

Appends a “tinyint” to the collection.

Parameters:
  • collection – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_int16(CassCollection *collection, cass_int16_t value)¶

Appends an “smallint” to the collection.

Parameters:
  • collection – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_int32(CassCollection *collection, cass_int32_t value)¶

Appends an “int” to the collection.

Parameters:
  • collection – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_uint32(CassCollection *collection, cass_uint32_t value)¶

Appends a “date” to the collection.

Parameters:
  • collection – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_int64(CassCollection *collection, cass_int64_t value)¶

Appends a “bigint”, “counter”, “timestamp” or “time” to the collection.

Parameters:
  • collection – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_float(CassCollection *collection, cass_float_t value)¶

Appends a “float” to the collection.

Parameters:
  • collection – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_double(CassCollection *collection, cass_double_t value)¶

Appends a “double” to the collection.

Parameters:
  • collection – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_bool(CassCollection *collection, cass_bool_t value)¶

Appends a “boolean” to the collection.

Parameters:
  • collection – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_string(CassCollection *collection, const char *value)¶

Appends an “ascii”, “text” or “varchar” to the collection.

Parameters:
  • collection – [in]

  • value – [in] The value is copied into the collection object; the memory pointed to by this parameter can be freed after this call.

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_string_n(CassCollection *collection, const char *value, size_t value_length)¶

Same as cass_collection_append_string(), but with lengths for string parameters.

See also

cass_collection_append_string();

Parameters:
  • collection – [in]

  • value – [in]

  • value_length – [in]

Returns:

same as cass_collection_append_string()

CassError cass_collection_append_bytes(CassCollection *collection, const cass_byte_t *value, size_t value_size)¶

Appends a “blob”, “varint” or “custom” to the collection.

Parameters:
  • collection – [in]

  • value – [in] The value is copied into the collection object; the memory pointed to by this parameter can be freed after this call.

  • value_size – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_uuid(CassCollection *collection, CassUuid value)¶

Appends a “uuid” or “timeuuid” to the collection.

Parameters:
  • collection – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_inet(CassCollection *collection, CassInet value)¶

Appends an “inet” to the collection.

Parameters:
  • collection – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_decimal(CassCollection *collection, const cass_byte_t *varint, size_t varint_size, cass_int32_t scale)¶

Appends a “decimal” to the collection.

Parameters:
  • collection – [in]

  • varint – [in] The value is copied into the collection object; the memory pointed to by this parameter can be freed after this call.

  • varint_size – [in]

  • scale – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_duration(CassCollection *collection, cass_int32_t months, cass_int32_t days, cass_int64_t nanos)¶

Appends a “duration” to the collection.

Requires Apache Cassandra: 3.10+

Parameters:
  • collection – [in]

  • months – [in]

  • days – [in]

  • nanos – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_collection(CassCollection *collection, const CassCollection *value)¶

Appends a “list”, “map” or “set” to the collection.

Parameters:
  • collection – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_tuple(CassCollection *collection, const CassTuple *value)¶

Appends a “tuple” to the collection.

Parameters:
  • collection – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_user_type(CassCollection *collection, const CassUserType *value)¶

Appends a “udt” to the collection.

Parameters:
  • collection – [in]

  • value – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_custom(CassCollection *collection, const char *class_name, const cass_byte_t *value, size_t value_size)¶

Appends a “custom” to the collection.

Parameters:
  • collection – [in]

  • class_name – [in]

  • value – [in] The value is copied into the collection object; the memory pointed to by this parameter can be freed after this call.

  • value_size – [in]

Returns:

CASS_OK if successful, otherwise an error occurred.

CassError cass_collection_append_custom_n(CassCollection *collection, const char *class_name, size_t class_name_length, const cass_byte_t *value, size_t value_size)¶

Same as cass_collection_append_custom(), but with lengths for string parameters.

See also

cass_collection_append_custom()

Parameters:
  • collection – [in]

  • class_name – [in]

  • class_name_length – [in]

  • value – [in]

  • value_size – [in]

Returns:

same as cass_collection_append_custom()

Was this page helpful?

PREVIOUS
CassCluster
NEXT
CassColumnMeta
  • Create an issue
  • Edit this page

On this page

  • CassCollection
    • CassCollection
      • CassCollectionType
      • cass_collection_new()
      • cass_collection_new_from_data_type()
      • cass_collection_free()
      • cass_collection_data_type()
      • cass_collection_append_int8()
      • cass_collection_append_int16()
      • cass_collection_append_int32()
      • cass_collection_append_uint32()
      • cass_collection_append_int64()
      • cass_collection_append_float()
      • cass_collection_append_double()
      • cass_collection_append_bool()
      • cass_collection_append_string()
      • cass_collection_append_string_n()
      • cass_collection_append_bytes()
      • cass_collection_append_uuid()
      • cass_collection_append_inet()
      • cass_collection_append_decimal()
      • cass_collection_append_duration()
      • cass_collection_append_collection()
      • cass_collection_append_tuple()
      • cass_collection_append_user_type()
      • cass_collection_append_custom()
      • cass_collection_append_custom_n()
ScyllaDB CPP RS Driver
  • master
    • master
    • v1.0.0
  • ScyllaDB CPP RS Driver
  • API Documentation
    • BasicTypes
    • CassConsistency
    • CassError
    • CassValueType
    • CustomAllocator
    • Logging
    • Miscellaneous
    • CassAggregateMeta
    • CassAuthenticator
    • CassAuthenticatorCallbacks
    • CassBatch
    • CassCluster
    • CassCollection
    • CassColumnMeta
    • CassCustomPayload
    • CassDataType
    • CassErrorResult
    • CassExecProfile
    • CassFunctionMeta
    • CassFuture
    • CassIndexMeta
    • CassInet
    • CassIterator
    • CassKeyspaceMeta
    • CassMaterializedViewMeta
    • CassMetrics
    • CassNode
    • CassPrepared
    • CassResult
    • CassRetryPolicy
    • CassRow
    • CassSchemaMeta
    • CassSession
    • CassSpeculativeExecutionMetrics
    • CassSsl
    • CassStatement
    • CassTableMeta
    • CassTimestampGen
    • CassTuple
    • CassUserType
    • CassUuid
    • CassUuidGen
    • CassValue
    • CassVersion
  • Getting Started
  • Architecture Overview
  • Installation
  • Building
  • Testing
  • Using the Driver
    • Batches
    • Binding Parameters
    • Client-side timestamps
    • Consistency
    • Data Types
      • The date and time Types
      • Tuples
      • User-Defined Types (UDTs)
      • UUIDs
    • Futures
    • Handling Results
    • Keyspaces
    • Prepared Statements
    • Schema Metadata
  • Configuration
    • Load balancing
    • Retry policies
    • Speculative Execution
    • Connection
    • Execution Profiles
    • Performance Tips
    • Client Configuration
  • Security
    • Authentication
    • TLS
  • Observability
    • Logging
    • Tracing
    • Metrics
Docs Tutorials University Contact Us About Us
© 2026, ScyllaDB. All rights reserved. | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 17 Mar 2026.
Powered by Sphinx 9.1.0 & ScyllaDB Theme 1.9.1
Ask AI