From d4b75b113b0a8fa9688d6dffeefc0c8de87bbf39 Mon Sep 17 00:00:00 2001 From: Wen Yu Ge Date: Mon, 14 Mar 2022 16:54:55 -0400 Subject: [PATCH 1/4] Adds reference to query class and query guide in list document --- app/controllers/api/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index a4c705596c..d04d1d78b8 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -1687,7 +1687,7 @@ App::get('/v1/database/collections/:collectionId/documents') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_DOCUMENT_LIST) ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).') - ->param('queries', [], new ArrayList(new Text(0), 100), 'Array of query strings.', true) + ->param('queries', [], new ArrayList(new Text(0), 100), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/database#querying-documents).', true) ->param('limit', 25, new Range(0, 100), 'Maximum number of documents to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true) ->param('offset', 0, new Range(0, APP_LIMIT_COUNT), 'Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)', true) ->param('cursor', '', new UID(), 'ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)', true) From 02ef450b3ae715d86e73cd884a48769e5427a3e5 Mon Sep 17 00:00:00 2001 From: Wen Yu Ge Date: Mon, 14 Mar 2022 17:00:50 -0400 Subject: [PATCH 2/4] Updates description of document data updates, so users only include fields that needs and update. --- app/controllers/api/database.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index d04d1d78b8..cec4ff197b 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -1570,7 +1570,7 @@ App::post('/v1/database/collections/:collectionId/documents') ->label('sdk.response.model', Response::MODEL_DOCUMENT) ->param('documentId', '', new CustomId(), 'Document ID. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('collectionId', null, new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection). Make sure to define attributes before creating documents.') - ->param('data', [], new JSON(), 'Document data as JSON object.') + ->param('data', [], new JSON(), 'Document data as JSON object. ') ->param('read', null, new Permissions(), 'An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.', true) ->param('write', null, new Permissions(), 'An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.', true) ->inject('response') @@ -1949,7 +1949,7 @@ App::patch('/v1/database/collections/:collectionId/documents/:documentId') ->label('sdk.response.model', Response::MODEL_DOCUMENT) ->param('collectionId', null, new UID(), 'Collection ID.') ->param('documentId', null, new UID(), 'Document ID.') - ->param('data', [], new JSON(), 'Document data as JSON object.') + ->param('data', [], new JSON(), 'Document data as JSON object. Include only attribute and value pairs to be updated.') ->param('read', null, new Permissions(), 'An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.', true) ->param('write', null, new Permissions(), 'An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.', true) ->inject('response') From 7f9f9f84a6babe770deb19b9a283e121e72751a8 Mon Sep 17 00:00:00 2001 From: Wen Yu Ge Date: Mon, 14 Mar 2022 17:27:21 -0400 Subject: [PATCH 3/4] remove reference for legacy code --- docs/references/database/delete-document.md | 2 +- docs/services/database.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/references/database/delete-document.md b/docs/references/database/delete-document.md index 159a0fbcea..36fbf6802d 100644 --- a/docs/references/database/delete-document.md +++ b/docs/references/database/delete-document.md @@ -1 +1 @@ -Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted. \ No newline at end of file +Delete a document by its unique ID. \ No newline at end of file diff --git a/docs/services/database.md b/docs/services/database.md index fbd72aee39..9d46d38a76 100644 --- a/docs/services/database.md +++ b/docs/services/database.md @@ -1,6 +1,6 @@ The Database service allows you to create structured collections of documents, query and filter lists of documents, and manage an advanced set of read and write access permissions. -All the data in the database service is stored in structured JSON documents. The Appwrite database service also allows you to nest child documents in parent documents and use deep filters to both search and query your data. +All the data in the database service is stored in structured JSON documents. Each database document structure in your project is defined using the Appwrite [collection attributes](/docs/database#attributes). The collection attributes help you ensure all your user-submitted data is validated and stored according to the collection structure. From a055341a5a0af921a98d12e23325dfa182549322 Mon Sep 17 00:00:00 2001 From: Wen Yu Ge Date: Tue, 15 Mar 2022 11:22:48 -0400 Subject: [PATCH 4/4] remove accidental space at end of sentence --- app/controllers/api/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index cec4ff197b..1cf78b07e3 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -1570,7 +1570,7 @@ App::post('/v1/database/collections/:collectionId/documents') ->label('sdk.response.model', Response::MODEL_DOCUMENT) ->param('documentId', '', new CustomId(), 'Document ID. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('collectionId', null, new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection). Make sure to define attributes before creating documents.') - ->param('data', [], new JSON(), 'Document data as JSON object. ') + ->param('data', [], new JSON(), 'Document data as JSON object.') ->param('read', null, new Permissions(), 'An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.', true) ->param('write', null, new Permissions(), 'An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](https://appwrite.io/docs/permissions) and get a full list of available permissions.', true) ->inject('response')