dataStore.DeleteResult

Note:

The content in this help topic pertains to SuiteScript 2.1.

Object Description

Contains the number of documents deleted.

Returned by Collection.deleteOne(query) and Collection.deleteMany(query).

Supported Script Types

Server scripts

Module

N/dataStore Module

Methods and Properties

DeleteResult Object Members

Since

2026.2

DeleteResult Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

DeleteResult.deletedCount

number

Server scripts

The number of documents deleted.

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');
const result = await collection.deleteOne({ status: 'complete' });
const deletedCount = result.deletedCount;

...
// Add additional code 

          

General Notices