mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
18 lines
501 B
Markdown
18 lines
501 B
Markdown
import { Client, Databases } from "react-native-appwrite";
|
|
|
|
const client = new Client()
|
|
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
|
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
|
|
|
const databases = new Databases(client);
|
|
|
|
const result = await databases.createDocument(
|
|
'<DATABASE_ID>', // databaseId
|
|
'<COLLECTION_ID>', // collectionId
|
|
'<DOCUMENT_ID>', // documentId
|
|
{}, // data
|
|
["read("any")"] // permissions (optional)
|
|
);
|
|
|
|
console.log(result);
|