appwrite/docs/examples/1.8.x/client-react-native/examples/databases/increment-document-attribute.md

20 lines
575 B
Markdown
Raw Normal View History

2025-08-20 07:22:48 +00:00
import { Client, Databases } from "react-native-appwrite";
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.incrementDocumentAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
attribute: '',
2025-09-05 12:00:39 +00:00
value: 0, // optional
2025-10-09 08:04:50 +00:00
max: 0, // optional
transactionId: '<TRANSACTION_ID>' // optional
2025-08-20 07:22:48 +00:00
});
console.log(result);