dataStore.FindResult

Note:

The content in this help topic pertains to SuiteScript 2.1.

Object Description

Contains a matching document and its metadata.

Returned for each matching document when you iterate through the dataStore.Cursor from Collection.find(query).

Both properties are read-only. When there are no document matches, the cursor returns no results.

Supported Script Types

Server scripts

Module

N/dataStore Module

Methods and Properties

FindResult Object Members

Since

2026.2

FindResult Object Members

Member Type

Name

Return Type / Value Type

Supported Script Types

Description

Property

FindResult.document

dataStore.Document

Server scripts

The document that matches the query.

Property

FindResult.metadata

dataStore.DocumentMetadata

Server scripts

The matching document's metadata.

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 cursor = await collection.find({ status: 'pending' });

for await (const result of cursor) {
    const document = result.document;
    const metadata = result.metadata;
}

...
// Add additional code 

          

General Notices