Documents_
Create, read, update, and delete documents in Appwrite DocumentsDB. Learn how to work with schemaless JSON documents in your collections.
1 min read
Each piece of data in Appwrite DocumentsDB is a document. Documents are schemaless JSON, so each document in a collection can hold its own set of fields.
Create documents
You must grant create permissions to users at the collection level before users can create documents. Learn more about permissions
Use the createDocument method to add a document to a collection. Appwrite Server SDKs require an API key.
List documents
Use the listDocuments method to read documents from a collection. Pass queries to filter, order, and paginate the results.
Pass a ttl value in seconds (1 to 86400) to cache the response. Identical requests return the cached result until the TTL expires, and the X-Appwrite-Cache header reports hit or miss. See cache list responses.
Update document
Use the updateDocument method to update a document. With the patch behavior, you only pass the fields you want to change.
Upsert documents
Use the upsertDocument method to create a document if it doesn't exist, or update it if it does.
Delete document
Use the deleteDocument method to remove a document from a collection.
Permissions
To access documents through a Client SDK, you must grant the relevant permissions. By default, Appwrite doesn't grant any user permissions when a new collection is created.
You can configure permissions at the collection level, or enable documentSecurity on the collection to also set permissions on individual documents.
Was this page helpful?
Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.