dataStore.InsertOneResult
The content in this help topic pertains to SuiteScript 2.1.
|
Object Description |
Contains an inserted document's generated identifier and metadata. Returned by Collection.insertOne(document) and included in InsertManyResult.inserted for Collection.insertMany(documents). Both properties are read-only. |
|
Supported Script Types |
Server scripts |
|
Module |
|
|
Methods and Properties |
|
|
Since |
2026.2 |
InsertOneResult Object Members
|
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
|---|---|---|---|---|
|
Property |
string |
Server scripts |
The inserted document's generated |
|
|
Property |
Server scripts |
The inserted document's metadata. |
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.insertOne({ status: 'pending' });
const documentId = result.insertedId;
const metadata = result.metadata;
...
// Add additional code