Datastore.getCollection(id)
The content in this help topic pertains to SuiteScript 2.1.
|
Method Description |
Returns a dataStore.Collection object for the specified collection in this data store. This method doesn't read or write stored documents. |
|
Returns |
|
|
Supported Script Types |
Server scripts |
|
Governance |
None |
|
Module |
|
|
Parent Object |
|
|
Sibling Object Members |
|
|
Since |
2026.2 |
Parameters
|
Parameter |
Type |
Required / Optional |
Description |
Since |
|---|---|---|---|---|
|
|
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 |
|---|---|---|
|
|
The collection identifier must be a string with 1 to 64 ASCII letters, digits, underscores, dots, or hyphens. |
The identifier is not a string or does not meet the identifier rules. |
Syntax
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 store = dataStore.getDatastore('processing');
const collection = store.getCollection('checkpoints');
...
// Add additional code