dataStore.getCollection(id)

Note:

The content in this help topic pertains to SuiteScript 2.1.

Method Description

Returns a dataStore.Collection object for the specified collection in the default data store.

This is equivalent to calling dataStore.getDatastore('default').getCollection(id). This method doesn't read or write stored documents.

Returns

dataStore.Collection

Supported Script Types

Server scripts

Governance

None

Module

N/dataStore Module

Sibling Module Members

N/dataStore Module Members

Since

2026.2

Parameters

Parameter

Type

Required / Optional

Description

Since

id

string

required

The identifier of the collection to access.

Use 1-64 ASCII letters, digits, underscores, dots, or hyphens. Collection identifiers are case-insensitive.

2026.2

Errors

Error Code

Error Message

Thrown If

TypeError

The collection identifier must be a string with 1 to 64 ASCII letters, digits, underscores, dots, or hyphens.

The identifier isn't a string or doesn't meet the identifier rules.

Syntax

Important:

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 collection = dataStore.getCollection('checkpoints');

...
// Add additional code 

          

General Notices