Internal
Should not be instantiated by the user.
Readonly
commandThe original command that was sent to the API, as a plain object. This is the raw command, not necessarily in the exact format the client may use, in some rare cases.
{
insertOne: {
document: { _id: 'doc10', name: 'Document 10' },
},
}
Readonly
messageA human-readable message describing the first error.
This is always equal to errorDescriptors[0]?.message
if it exists, otherwise it's given a generic
default message.
Readonly
rawThe raw response from the API
{
status: {
insertedIds: [ 'id1', 'id2', 'id3']
},
errors: [
{
family: 'REQUEST',
scope: 'DOCUMENT',
errorCode: 'DOCUMENT_ALREADY_EXISTS',
id: 'e4be94b6-e8b5-4652-961b-5c9fe12d2f1a',
title: 'Document already exists with the given _id',
message: 'Document already exists with the given _id',
},
]
}
Optional
stackStatic
Optional
prepareOptional override for formatting stack traces
Static
stackA list of error descriptors representing the individual errors returned by the API.
This will likely be a singleton list in many cases, such as for insertOne
or deleteOne
commands, but may be
longer for bulk operations like insertMany
which may have multiple insertion errors.
A list of error descriptors representing the individual errors returned by the API.
This will likely be a singleton list in many cases, such as for insertOne
or deleteOne
commands, but may be
longer for bulk operations like insertMany
which may have multiple insertion errors.
Static
capture
Overview
An error representing a 2XX error returned from the Data API (such as duplicate ID errors, certain validation errors, etc.)