mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
chore: sync up sdks and specs
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Databases;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
|
||||
|
||||
Databases databases = new Databases(client);
|
||||
|
||||
databases.createDocuments(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
listOf(), // documents
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
Log.d("Appwrite", result.toString());
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Databases
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
|
||||
val databases = Databases(client)
|
||||
|
||||
val result = databases.createDocuments(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
documents = listOf(),
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
import Appwrite
|
||||
|
||||
let client = Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
|
||||
let databases = Databases(client)
|
||||
|
||||
let documentList = try await databases.createDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
documents: []
|
||||
)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Databases databases = Databases(client);
|
||||
|
||||
DocumentList result = await databases.createDocuments(
|
||||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
documents: [],
|
||||
);
|
||||
@@ -0,0 +1,18 @@
|
||||
mutation {
|
||||
databasesCreateDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
documents: []
|
||||
) {
|
||||
total
|
||||
documents {
|
||||
_id
|
||||
_collectionId
|
||||
_databaseId
|
||||
_createdAt
|
||||
_updatedAt
|
||||
_permissions
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,10 @@ mutation {
|
||||
) {
|
||||
_id
|
||||
_createdAt
|
||||
_permissions
|
||||
resourceId
|
||||
resourceInternalId
|
||||
resourceType
|
||||
expire
|
||||
accessedAt
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,10 @@ mutation {
|
||||
) {
|
||||
_id
|
||||
_createdAt
|
||||
_permissions
|
||||
resourceId
|
||||
resourceInternalId
|
||||
resourceType
|
||||
expire
|
||||
accessedAt
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
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.createDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
[] // documents
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -0,0 +1,11 @@
|
||||
POST /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1
|
||||
Host: cloud.appwrite.io
|
||||
Content-Type: application/json
|
||||
X-Appwrite-Response-Format: 1.7.0
|
||||
X-Appwrite-Project: <YOUR_PROJECT_ID>
|
||||
X-Appwrite-Session:
|
||||
X-Appwrite-JWT: <YOUR_JWT>
|
||||
|
||||
{
|
||||
"documents": []
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Client, Databases } from "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.createDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
[] // documents
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -0,0 +1,4 @@
|
||||
appwrite databases createDocuments \
|
||||
--databaseId <DATABASE_ID> \
|
||||
--collectionId <COLLECTION_ID> \
|
||||
--documents one two three
|
||||
@@ -0,0 +1,4 @@
|
||||
appwrite databases deleteDocuments \
|
||||
--databaseId <DATABASE_ID> \
|
||||
--collectionId <COLLECTION_ID> \
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
appwrite databases updateDocuments \
|
||||
--databaseId <DATABASE_ID> \
|
||||
--collectionId <COLLECTION_ID> \
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
appwrite databases upsertDocuments \
|
||||
--databaseId <DATABASE_ID> \
|
||||
--collectionId <COLLECTION_ID> \
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
appwrite projects listDevKeys \
|
||||
--projectId <PROJECT_ID> \
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Client, Databases } from "@appwrite.io/console";
|
||||
|
||||
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.createDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
[] // documents
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Client, Databases } from "@appwrite.io/console";
|
||||
|
||||
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.deleteDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
[] // queries (optional)
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Client, Databases } from "@appwrite.io/console";
|
||||
|
||||
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.updateDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
{}, // data (optional)
|
||||
[] // queries (optional)
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Client, Databases } from "@appwrite.io/console";
|
||||
|
||||
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.upsertDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
[] // documents (optional)
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
@@ -8,8 +8,7 @@ const projects = new Projects(client);
|
||||
|
||||
const result = await projects.listDevKeys(
|
||||
'<PROJECT_ID>', // projectId
|
||||
[], // queries (optional)
|
||||
'<SEARCH>' // search (optional)
|
||||
[] // queries (optional)
|
||||
);
|
||||
|
||||
console.log(result);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import 'package:dart_appwrite/dart_appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setSession(''); // The user session to authenticate with
|
||||
|
||||
Databases databases = Databases(client);
|
||||
|
||||
DocumentList result = await databases.createDocuments(
|
||||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
documents: [],
|
||||
);
|
||||
@@ -0,0 +1,14 @@
|
||||
import 'package:dart_appwrite/dart_appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
Databases databases = Databases(client);
|
||||
|
||||
await databases.deleteDocuments(
|
||||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
queries: [], // (optional)
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
import 'package:dart_appwrite/dart_appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
Databases databases = Databases(client);
|
||||
|
||||
DocumentList result = await databases.updateDocuments(
|
||||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
data: {}, // (optional)
|
||||
queries: [], // (optional)
|
||||
);
|
||||
@@ -0,0 +1,14 @@
|
||||
import 'package:dart_appwrite/dart_appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
Databases databases = Databases(client);
|
||||
|
||||
DocumentList result = await databases.upsertDocuments(
|
||||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
documents: [], // (optional)
|
||||
);
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setSession(''); // The user session to authenticate with
|
||||
|
||||
const databases = new Databases(client);
|
||||
|
||||
const response = await databases.createDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
[] // documents
|
||||
);
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
const databases = new Databases(client);
|
||||
|
||||
const response = await databases.deleteDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
[] // queries (optional)
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
const databases = new Databases(client);
|
||||
|
||||
const response = await databases.updateDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
{}, // data (optional)
|
||||
[] // queries (optional)
|
||||
);
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Client, Databases } from "https://deno.land/x/appwrite/mod.ts";
|
||||
|
||||
const client = new Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
const databases = new Databases(client);
|
||||
|
||||
const response = await databases.upsertDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
[] // documents (optional)
|
||||
);
|
||||
@@ -0,0 +1,16 @@
|
||||
using Appwrite;
|
||||
using Appwrite.Models;
|
||||
using Appwrite.Services;
|
||||
|
||||
Client client = new Client()
|
||||
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.SetSession(""); // The user session to authenticate with
|
||||
|
||||
Databases databases = new Databases(client);
|
||||
|
||||
DocumentList result = await databases.CreateDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
documents: new List<object>()
|
||||
);
|
||||
@@ -0,0 +1,16 @@
|
||||
using Appwrite;
|
||||
using Appwrite.Models;
|
||||
using Appwrite.Services;
|
||||
|
||||
Client client = new Client()
|
||||
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.SetKey("<YOUR_API_KEY>"); // Your secret API key
|
||||
|
||||
Databases databases = new Databases(client);
|
||||
|
||||
await databases.DeleteDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
queries: new List<string>() // optional
|
||||
);
|
||||
@@ -0,0 +1,17 @@
|
||||
using Appwrite;
|
||||
using Appwrite.Models;
|
||||
using Appwrite.Services;
|
||||
|
||||
Client client = new Client()
|
||||
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.SetKey("<YOUR_API_KEY>"); // Your secret API key
|
||||
|
||||
Databases databases = new Databases(client);
|
||||
|
||||
DocumentList result = await databases.UpdateDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
data: [object], // optional
|
||||
queries: new List<string>() // optional
|
||||
);
|
||||
@@ -0,0 +1,16 @@
|
||||
using Appwrite;
|
||||
using Appwrite.Models;
|
||||
using Appwrite.Services;
|
||||
|
||||
Client client = new Client()
|
||||
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.SetKey("<YOUR_API_KEY>"); // Your secret API key
|
||||
|
||||
Databases databases = new Databases(client);
|
||||
|
||||
DocumentList result = await databases.UpsertDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
documents: new List<object>() // optional
|
||||
);
|
||||
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/appwrite/sdk-for-go/client"
|
||||
"github.com/appwrite/sdk-for-go/databases"
|
||||
)
|
||||
|
||||
func main() {
|
||||
client := client.NewClient()
|
||||
|
||||
client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
client.SetProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
client.SetSession("") // The user session to authenticate with
|
||||
|
||||
service := databases.NewDatabases(client)
|
||||
response, error := service.CreateDocuments(
|
||||
"<DATABASE_ID>",
|
||||
"<COLLECTION_ID>",
|
||||
[]interface{}{},
|
||||
)
|
||||
|
||||
if error != nil {
|
||||
panic(error)
|
||||
}
|
||||
|
||||
fmt.Println(response)
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/appwrite/sdk-for-go/client"
|
||||
"github.com/appwrite/sdk-for-go/databases"
|
||||
)
|
||||
|
||||
func main() {
|
||||
client := client.NewClient()
|
||||
|
||||
client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
client.SetProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
client.SetKey("<YOUR_API_KEY>") // Your secret API key
|
||||
|
||||
service := databases.NewDatabases(client)
|
||||
response, error := service.DeleteDocuments(
|
||||
"<DATABASE_ID>",
|
||||
"<COLLECTION_ID>",
|
||||
databases.WithDeleteDocumentsQueries([]interface{}{}),
|
||||
)
|
||||
|
||||
if error != nil {
|
||||
panic(error)
|
||||
}
|
||||
|
||||
fmt.Println(response)
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/appwrite/sdk-for-go/client"
|
||||
"github.com/appwrite/sdk-for-go/databases"
|
||||
)
|
||||
|
||||
func main() {
|
||||
client := client.NewClient()
|
||||
|
||||
client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
client.SetProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
client.SetKey("<YOUR_API_KEY>") // Your secret API key
|
||||
|
||||
service := databases.NewDatabases(client)
|
||||
response, error := service.UpdateDocuments(
|
||||
"<DATABASE_ID>",
|
||||
"<COLLECTION_ID>",
|
||||
databases.WithUpdateDocumentsData(map[string]interface{}{}),
|
||||
databases.WithUpdateDocumentsQueries([]interface{}{}),
|
||||
)
|
||||
|
||||
if error != nil {
|
||||
panic(error)
|
||||
}
|
||||
|
||||
fmt.Println(response)
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/appwrite/sdk-for-go/client"
|
||||
"github.com/appwrite/sdk-for-go/databases"
|
||||
)
|
||||
|
||||
func main() {
|
||||
client := client.NewClient()
|
||||
|
||||
client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
client.SetProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
client.SetKey("<YOUR_API_KEY>") // Your secret API key
|
||||
|
||||
service := databases.NewDatabases(client)
|
||||
response, error := service.UpsertDocuments(
|
||||
"<DATABASE_ID>",
|
||||
"<COLLECTION_ID>",
|
||||
databases.WithUpsertDocumentsDocuments([]interface{}{}),
|
||||
)
|
||||
|
||||
if error != nil {
|
||||
panic(error)
|
||||
}
|
||||
|
||||
fmt.Println(response)
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
mutation {
|
||||
databasesCreateDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
documents: []
|
||||
) {
|
||||
total
|
||||
documents {
|
||||
_id
|
||||
_collectionId
|
||||
_databaseId
|
||||
_createdAt
|
||||
_updatedAt
|
||||
_permissions
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
mutation {
|
||||
databasesDeleteDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
queries: []
|
||||
) {
|
||||
total
|
||||
documents {
|
||||
_id
|
||||
_collectionId
|
||||
_databaseId
|
||||
_createdAt
|
||||
_updatedAt
|
||||
_permissions
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
mutation {
|
||||
databasesUpdateDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
data: "{}",
|
||||
queries: []
|
||||
) {
|
||||
total
|
||||
documents {
|
||||
_id
|
||||
_collectionId
|
||||
_databaseId
|
||||
_createdAt
|
||||
_updatedAt
|
||||
_permissions
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
mutation {
|
||||
databasesUpsertDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
documents: []
|
||||
) {
|
||||
total
|
||||
documents {
|
||||
_id
|
||||
_collectionId
|
||||
_databaseId
|
||||
_createdAt
|
||||
_updatedAt
|
||||
_permissions
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,10 @@ mutation {
|
||||
) {
|
||||
_id
|
||||
_createdAt
|
||||
_permissions
|
||||
resourceId
|
||||
resourceInternalId
|
||||
resourceType
|
||||
expire
|
||||
accessedAt
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,10 @@ mutation {
|
||||
) {
|
||||
_id
|
||||
_createdAt
|
||||
_permissions
|
||||
resourceId
|
||||
resourceInternalId
|
||||
resourceType
|
||||
expire
|
||||
accessedAt
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Databases;
|
||||
|
||||
Client client = new Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setSession(""); // The user session to authenticate with
|
||||
|
||||
Databases databases = new Databases(client);
|
||||
|
||||
databases.createDocuments(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
listOf(), // documents
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Databases;
|
||||
|
||||
Client client = new Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>"); // Your secret API key
|
||||
|
||||
Databases databases = new Databases(client);
|
||||
|
||||
databases.deleteDocuments(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
listOf(), // queries (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Databases;
|
||||
|
||||
Client client = new Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>"); // Your secret API key
|
||||
|
||||
Databases databases = new Databases(client);
|
||||
|
||||
databases.updateDocuments(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
mapOf( "a" to "b" ), // data (optional)
|
||||
listOf(), // queries (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Databases;
|
||||
|
||||
Client client = new Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>"); // Your secret API key
|
||||
|
||||
Databases databases = new Databases(client);
|
||||
|
||||
databases.upsertDocuments(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
listOf(), // documents (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Databases
|
||||
|
||||
val client = Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setSession("") // The user session to authenticate with
|
||||
|
||||
val databases = Databases(client)
|
||||
|
||||
val response = databases.createDocuments(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
documents = listOf()
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Databases
|
||||
|
||||
val client = Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>") // Your secret API key
|
||||
|
||||
val databases = Databases(client)
|
||||
|
||||
val response = databases.deleteDocuments(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
queries = listOf() // optional
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Databases
|
||||
|
||||
val client = Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>") // Your secret API key
|
||||
|
||||
val databases = Databases(client)
|
||||
|
||||
val response = databases.updateDocuments(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
data = mapOf( "a" to "b" ), // optional
|
||||
queries = listOf() // optional
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Databases
|
||||
|
||||
val client = Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>") // Your secret API key
|
||||
|
||||
val databases = Databases(client)
|
||||
|
||||
val response = databases.upsertDocuments(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
documents = listOf() // optional
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
const sdk = require('node-appwrite');
|
||||
|
||||
const client = new sdk.Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setSession(''); // The user session to authenticate with
|
||||
|
||||
const databases = new sdk.Databases(client);
|
||||
|
||||
const result = await databases.createDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
[] // documents
|
||||
);
|
||||
@@ -0,0 +1,14 @@
|
||||
const sdk = require('node-appwrite');
|
||||
|
||||
const client = new sdk.Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
const databases = new sdk.Databases(client);
|
||||
|
||||
const result = await databases.deleteDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
[] // queries (optional)
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
const sdk = require('node-appwrite');
|
||||
|
||||
const client = new sdk.Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
const databases = new sdk.Databases(client);
|
||||
|
||||
const result = await databases.updateDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
{}, // data (optional)
|
||||
[] // queries (optional)
|
||||
);
|
||||
@@ -0,0 +1,14 @@
|
||||
const sdk = require('node-appwrite');
|
||||
|
||||
const client = new sdk.Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
.setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
const databases = new sdk.Databases(client);
|
||||
|
||||
const result = await databases.upsertDocuments(
|
||||
'<DATABASE_ID>', // databaseId
|
||||
'<COLLECTION_ID>', // collectionId
|
||||
[] // documents (optional)
|
||||
);
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use Appwrite\Client;
|
||||
use Appwrite\Services\Databases;
|
||||
|
||||
$client = (new Client())
|
||||
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
->setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
->setSession(''); // The user session to authenticate with
|
||||
|
||||
$databases = new Databases($client);
|
||||
|
||||
$result = $databases->createDocuments(
|
||||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
documents: []
|
||||
);
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use Appwrite\Client;
|
||||
use Appwrite\Services\Databases;
|
||||
|
||||
$client = (new Client())
|
||||
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
->setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
->setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
$databases = new Databases($client);
|
||||
|
||||
$result = $databases->deleteDocuments(
|
||||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
queries: [] // optional
|
||||
);
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Appwrite\Client;
|
||||
use Appwrite\Services\Databases;
|
||||
|
||||
$client = (new Client())
|
||||
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
->setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
->setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
$databases = new Databases($client);
|
||||
|
||||
$result = $databases->updateDocuments(
|
||||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
data: [], // optional
|
||||
queries: [] // optional
|
||||
);
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use Appwrite\Client;
|
||||
use Appwrite\Services\Databases;
|
||||
|
||||
$client = (new Client())
|
||||
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
->setProject('<YOUR_PROJECT_ID>') // Your project ID
|
||||
->setKey('<YOUR_API_KEY>'); // Your secret API key
|
||||
|
||||
$databases = new Databases($client);
|
||||
|
||||
$result = $databases->upsertDocuments(
|
||||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
documents: [] // optional
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_session('') # The user session to authenticate with
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.create_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
documents = []
|
||||
)
|
||||
@@ -0,0 +1,15 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.delete_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
queries = [] # optional
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.update_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
data = {}, # optional
|
||||
queries = [] # optional
|
||||
)
|
||||
@@ -0,0 +1,15 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.upsert_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
documents = [] # optional
|
||||
)
|
||||
@@ -0,0 +1,12 @@
|
||||
POST /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1
|
||||
Host: cloud.appwrite.io
|
||||
Content-Type: application/json
|
||||
X-Appwrite-Response-Format: 1.7.0
|
||||
X-Appwrite-Project: <YOUR_PROJECT_ID>
|
||||
X-Appwrite-Session:
|
||||
X-Appwrite-Key: <YOUR_API_KEY>
|
||||
X-Appwrite-JWT: <YOUR_JWT>
|
||||
|
||||
{
|
||||
"documents": []
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
DELETE /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1
|
||||
Host: cloud.appwrite.io
|
||||
Content-Type: application/json
|
||||
X-Appwrite-Response-Format: 1.7.0
|
||||
X-Appwrite-Project: <YOUR_PROJECT_ID>
|
||||
X-Appwrite-Key: <YOUR_API_KEY>
|
||||
|
||||
{
|
||||
"queries": []
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
PATCH /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1
|
||||
Host: cloud.appwrite.io
|
||||
Content-Type: application/json
|
||||
X-Appwrite-Response-Format: 1.7.0
|
||||
X-Appwrite-Project: <YOUR_PROJECT_ID>
|
||||
X-Appwrite-Key: <YOUR_API_KEY>
|
||||
|
||||
{
|
||||
"data": {},
|
||||
"queries": []
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
PUT /v1/databases/{databaseId}/collections/{collectionId}/documents HTTP/1.1
|
||||
Host: cloud.appwrite.io
|
||||
Content-Type: application/json
|
||||
X-Appwrite-Response-Format: 1.7.0
|
||||
X-Appwrite-Project: <YOUR_PROJECT_ID>
|
||||
X-Appwrite-Key: <YOUR_API_KEY>
|
||||
|
||||
{
|
||||
"documents": []
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
require 'appwrite'
|
||||
|
||||
include Appwrite
|
||||
|
||||
client = Client.new
|
||||
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
.set_session('') # The user session to authenticate with
|
||||
|
||||
databases = Databases.new(client)
|
||||
|
||||
result = databases.create_documents(
|
||||
database_id: '<DATABASE_ID>',
|
||||
collection_id: '<COLLECTION_ID>',
|
||||
documents: []
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
require 'appwrite'
|
||||
|
||||
include Appwrite
|
||||
|
||||
client = Client.new
|
||||
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases.new(client)
|
||||
|
||||
result = databases.delete_documents(
|
||||
database_id: '<DATABASE_ID>',
|
||||
collection_id: '<COLLECTION_ID>',
|
||||
queries: [] # optional
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
require 'appwrite'
|
||||
|
||||
include Appwrite
|
||||
|
||||
client = Client.new
|
||||
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases.new(client)
|
||||
|
||||
result = databases.update_documents(
|
||||
database_id: '<DATABASE_ID>',
|
||||
collection_id: '<COLLECTION_ID>',
|
||||
data: {}, # optional
|
||||
queries: [] # optional
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
require 'appwrite'
|
||||
|
||||
include Appwrite
|
||||
|
||||
client = Client.new
|
||||
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases.new(client)
|
||||
|
||||
result = databases.upsert_documents(
|
||||
database_id: '<DATABASE_ID>',
|
||||
collection_id: '<COLLECTION_ID>',
|
||||
documents: [] # optional
|
||||
)
|
||||
@@ -0,0 +1,15 @@
|
||||
import Appwrite
|
||||
|
||||
let client = Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setSession("") // The user session to authenticate with
|
||||
|
||||
let databases = Databases(client)
|
||||
|
||||
let documentList = try await databases.createDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
documents: []
|
||||
)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import Appwrite
|
||||
|
||||
let client = Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>") // Your secret API key
|
||||
|
||||
let databases = Databases(client)
|
||||
|
||||
let documentList = try await databases.deleteDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
queries: [] // optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import Appwrite
|
||||
|
||||
let client = Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>") // Your secret API key
|
||||
|
||||
let databases = Databases(client)
|
||||
|
||||
let documentList = try await databases.updateDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
data: [:], // optional
|
||||
queries: [] // optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import Appwrite
|
||||
|
||||
let client = Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>") // Your secret API key
|
||||
|
||||
let databases = Databases(client)
|
||||
|
||||
let documentList = try await databases.upsertDocuments(
|
||||
databaseId: "<DATABASE_ID>",
|
||||
collectionId: "<COLLECTION_ID>",
|
||||
documents: [] // optional
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user