Class IncrementValueCommandProtected

Increment a value.

Increment treats the initial value as 0 if no value exists for the key. Increment adds the given amount to the value. An error is thrown if the value exists and is not a number.

Example

Use a bare-bones client and the command you need to make an API call.

import { StashClient, IncrementValueCommand } from "@stedi/sdk-client-stash"; // ES Modules import
// const { StashClient, IncrementValueCommand } = require("@stedi/sdk-client-stash"); // CommonJS import
const client = new StashClient(config);
const input = { // IncrementValueInput
keyspaceName: "STRING_VALUE", // required
key: "STRING_VALUE", // required
amount: "DOCUMENT_VALUE", // required
};
const command = new IncrementValueCommand(input);
const response = await client.send(command);
// { // ValueOutput
// key: "STRING_VALUE",
// value: "DOCUMENT_VALUE",
// };

Param

IncrementValueCommandInput

Returns

IncrementValueCommandOutput

See

Throws

KeyspaceNotFoundError (client fault)

Throws

AccessDeniedError (client fault)

Throws

InternalServerError (server fault)

Throws

ThrottledError (client fault)

Throws

UnauthorizedError (client fault)

Throws

ValidationError (client fault)

Throws

StashServiceException

Base exception class for all service exceptions from Stash service.

Hierarchy

Constructors

Properties

Constructors

Properties