dataStore.Collection
The content in this help topic pertains to SuiteScript 2.1.
|
Object Description |
Represents a collection of documents within a data store. Use its methods to insert, retrieve, update, and delete documents. This object is returned by dataStore.getCollection(id) and Datastore.getCollection(id). To select documents for retrieval, updates, or deletion, construct a query object and pass it to the corresponding collection method. For supported query syntax, see Data Store Query Object. For update operators, rules, and limits, see Data Store Update Object. Inserted documents must use supported property names. For the requirements, see Data Store Query Rules. When inserting, updating, or deleting documents, consider the following behavior:
Retrying an update that uses |
|
Supported Script Types |
Server scripts |
|
Module |
|
|
Methods and Properties |
|
|
Since |
2026.2 |
Collection Object Members
|
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
|---|---|---|---|---|
|
Method |
Server scripts |
Deletes all documents that match the query. |
||
|
Method |
Server scripts |
Deletes the first document that matches the query. |
||
|
Method |
Server scripts |
Finds all documents that match the query. |
||
|
Method |
Server scripts |
Finds the first document that matches the query. |
||
|
Method |
Server scripts |
Inserts multiple documents and generates an |
||
|
Method |
Server scripts |
Inserts one document and generates its |
||
|
Method |
Server scripts |
Updates all documents that match the query. |
||
|
Method |
Server scripts |
Updates the first document that matches the query. |
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 datastore = dataStore.getDatastore('processing');
const collection = datastore.getCollection('checkpoints');
...
// Add additional code