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
errorA 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.
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',
},
]
}
Overview
An object representing a complete error response from the Data API, including the original command that was sent, and the raw API response from the server.
Disclaimer
This is not used for "hard" (4XX, 5XX, timeout) errors, which are rarer and would be thrown directly by the underlying code.
Example
Field
errorDescriptors - A list of error descriptors representing the individual errors returned by the API
Field
command - The raw command send to the API
Field
rawResponse - The raw response from the API