Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 610 Bytes

File metadata and controls

20 lines (16 loc) · 610 Bytes
import { Client, DocumentsDB, Permission, Role } 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 documentsDB = new DocumentsDB(client);

const result = await documentsDB.updateDocument({
    databaseId: '<DATABASE_ID>',
    collectionId: '<COLLECTION_ID>',
    documentId: '<DOCUMENT_ID>',
    data: {}, // optional
    permissions: ["read("any")"], // optional
    transactionId: '<TRANSACTION_ID>' // optional
});

console.log(result);