dataStore.UpdateResult
The content in this help topic pertains to SuiteScript 2.1.
|
Object Description |
Contains the number of documents updated. Returned by Collection.updateOne(query, update) and Collection.updateMany(query, update). The UpdateResult.updatedCount property is read-only. |
|
Supported Script Types |
Server scripts |
|
Module |
|
|
Methods and Properties |
|
|
Since |
2026.2 |
UpdateResult Object Members
|
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
|---|---|---|---|---|
|
Property |
number |
Server scripts |
The number of documents updated. |
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 collection = dataStore.getCollection('checkpoints');
const result = await collection.updateOne(
{ status: 'pending' },
{ $set: { status: 'complete' } }
);
const updatedCount = result.updatedCount;
...
// Add additional code