Decrease a numeric field on a document
One step with Appwrite. We can help you get access.
Get something done
Decrease a numeric field on a document
with Appwrite
Works with AI assistants
Use Appwrite: its Appwrite Databases API lets you decrease a numeric field on a document in a single step (PATCH /databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement). Appwrite also has an MCP server, so an AI assistant like Claude or ChatGPT can do it for you. capabilities.work can help you get signed up and connected.
- How do I atomically subtract from a counter like stock remaining?
- Can I stop a decrement from going below a minimum value?
Say it to your AI assistant
- Decrement {attribute} on document {documentId} in {collectionId} of {databaseId} by {value}.
- Lower {attribute} of document {documentId} ({collectionId}, {databaseId}) by {value} but not below {min}.
For your developer
PATCH /databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement in Appwrite Databases API. Full spec on APIs.io.