Internal
Should not be instantiated by the user.
Optional
Readonly
collectionThe collection the command is being run on, if applicable.
Readonly
commandThe command object. Equal to the response body of the HTTP request.
Note that this is the actual raw command object; it's not necessarily 1:1 with methods called on the collection/db.
For example, a deleteAll
method on a collection will be translated into a deleteMany
command, and a bulkWrite
method will be translated into a series of insertOne
, updateOne
, etc. commands.
{
insertOne: { document: { name: 'John' } }
}
Readonly
commandThe command name.
This is the key of the command object. For example, if the command object is
{ insertOne: { document: { name: 'John' } } }
, the command name is insertOne
.
Meaning, abstracted commands like bulkWrite
, or deleteAll
will be shown as their actual command equivalents.
Readonly
durationThe duration of the command, in milliseconds. Starts counting from the moment of the initial HTTP request.
Readonly
keyspaceThe keyspace the command is being run in.
Readonly
namespaceThe keyspace the command is being run in.
This is now a deprecated alias for the strictly equivalent CommandEvent.keyspace, and will be removed in an upcoming major version.
https://docs.datastax.com/en/astra-db-serverless/api-reference/client-versions.html#version-1-5
Optional
Readonly
respThe response object from the Data API.
Readonly
urlThe URL the command is being sent to.
Readonly
warningsAny warnings returned from the Data API that may point out deprecated/incorrect practices, or any other issues that aren't strictly an error.
Emitted when a command has succeeded.
Note that these emit real commands, not any abstracted commands like "bulkWrite", "insertMany", or "deleteAll", which have to be translated into appropriate Data API commands.
See CommandEvent for more information about all the common properties available on this event.