mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Add server docs
This commit is contained in:
3871 files changed
+64270
No files matched your search
@@ -0,0 +1,18 @@
|
||||
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.create_boolean_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = False, # optional
|
||||
array = False # optional
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
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.create_collection(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
name = '<NAME>',
|
||||
permissions = ["read("any")"], # optional
|
||||
document_security = False, # optional
|
||||
enabled = False # optional
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
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.create_datetime_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = '', # optional
|
||||
array = False # optional
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
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_session('') # The user session to authenticate with
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.create_document(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
data = {},
|
||||
permissions = ["read("any")"] # optional
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
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_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.create_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
documents = []
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
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.create_email_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = 'email@example.com', # optional
|
||||
array = False # optional
|
||||
)
|
||||
@@ -0,0 +1,19 @@
|
||||
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.create_enum_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
elements = [],
|
||||
required = False,
|
||||
default = '<DEFAULT>', # optional
|
||||
array = False # optional
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
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.create_float_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
min = None, # optional
|
||||
max = None, # optional
|
||||
default = None, # optional
|
||||
array = False # optional
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
from appwrite.enums import IndexType
|
||||
|
||||
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.create_index(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
type = IndexType.KEY,
|
||||
attributes = [],
|
||||
orders = [], # optional
|
||||
lengths = [] # optional
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
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.create_integer_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
min = None, # optional
|
||||
max = None, # optional
|
||||
default = None, # optional
|
||||
array = False # optional
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
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.create_ip_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = '', # optional
|
||||
array = False # optional
|
||||
)
|
||||
@@ -0,0 +1,21 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
from appwrite.enums import RelationshipType
|
||||
|
||||
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.create_relationship_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
related_collection_id = '<RELATED_COLLECTION_ID>',
|
||||
type = RelationshipType.ONETOONE,
|
||||
two_way = False, # optional
|
||||
key = '', # optional
|
||||
two_way_key = '', # optional
|
||||
on_delete = RelationMutate.CASCADE # optional
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
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.create_string_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
size = 1,
|
||||
required = False,
|
||||
default = '<DEFAULT>', # optional
|
||||
array = False, # optional
|
||||
encrypt = False # optional
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
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.create_url_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = 'https://example.com', # optional
|
||||
array = False # 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.create(
|
||||
database_id = '<DATABASE_ID>',
|
||||
name = '<NAME>',
|
||||
enabled = False # 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.delete_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = ''
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
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_collection(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>'
|
||||
)
|
||||
@@ -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.delete_document(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>'
|
||||
)
|
||||
@@ -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,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_index(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = ''
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
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(
|
||||
database_id = '<DATABASE_ID>'
|
||||
)
|
||||
@@ -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.get_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = ''
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
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.get_collection(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>'
|
||||
)
|
||||
@@ -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_session('') # The user session to authenticate with
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.get_document(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
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.get_index(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = ''
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
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.get(
|
||||
database_id = '<DATABASE_ID>'
|
||||
)
|
||||
@@ -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.list_attributes(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
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.list_collections(
|
||||
database_id = '<DATABASE_ID>',
|
||||
queries = [], # optional
|
||||
search = '<SEARCH>' # 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.list_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
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.list_indexes(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
queries = [] # optional
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
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.list(
|
||||
queries = [], # optional
|
||||
search = '<SEARCH>' # optional
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
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_boolean_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = False,
|
||||
new_key = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
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_collection(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
name = '<NAME>',
|
||||
permissions = ["read("any")"], # optional
|
||||
document_security = False, # optional
|
||||
enabled = False # optional
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
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_datetime_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = '',
|
||||
new_key = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
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.update_document(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
data = {}, # optional
|
||||
permissions = ["read("any")"] # 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,18 @@
|
||||
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_email_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = 'email@example.com',
|
||||
new_key = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,19 @@
|
||||
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_enum_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
elements = [],
|
||||
required = False,
|
||||
default = '<DEFAULT>',
|
||||
new_key = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
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_float_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = None,
|
||||
min = None, # optional
|
||||
max = None, # optional
|
||||
new_key = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
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_integer_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = None,
|
||||
min = None, # optional
|
||||
max = None, # optional
|
||||
new_key = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
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_ip_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = '',
|
||||
new_key = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
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_relationship_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
on_delete = RelationMutate.CASCADE, # optional
|
||||
new_key = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,19 @@
|
||||
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_string_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = '<DEFAULT>',
|
||||
size = 1, # optional
|
||||
new_key = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
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_url_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = 'https://example.com',
|
||||
new_key = '' # 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.update(
|
||||
database_id = '<DATABASE_ID>',
|
||||
name = '<NAME>',
|
||||
enabled = False # 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
|
||||
)
|
||||
Reference in new issue
Block a user