$params = $this->getParam('params', []);

$events = $this->getParam('events', '');

$permissions = $this->getParam('permissions', Database::PERMISSIONS);

$escapedPermissions = \array_map(function ($perm) {

// Alpine won't bind to a parameter named delete :/

$form = $this->getParam('form', 'permissionsForm');

<?php

$logs = $this->getParam('logs', null);
$permissions = $this->getParam('permissions', null);

?>

        <button type="button" class="close pull-end" data-ui-modal-close=""></button>

JSON View

            <input type="hidden" data-ls-bind="{{project-collection}}" data-forms-code />

        <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

Documents

                <div
                    data-service="databases.listDocuments"
                    data-event="load,databases.createDocument,databases.updateDocument,databases.deleteDocument"
                    data-param-collection-id="{{router.params.id}}"
                    data-param-database-id="{{router.params.databaseId}}"
                    data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                    data-param-order-types="DESC"
                    data-param-order-types-cast-to="array"
                    data-scope="sdk"
                    data-name="project-documents"
                    x-data="{ project: new URLSearchParams(location.search).get('project') }">

No Documents Found

Add your first document to get started

<span data-ls-if="{{project-documents.total}} == <?php echo APP_LIMIT_COUNT; ?>">+ documents found

                                        $id
                                        <template x-for="attr in attributes">

                                                []

                                        </template>

                                    <template x-for="doc in documents">

                                                <a :href="`/console/databases/document?id=${doc.$id}&collection=${doc.$collection}&databaseId=${databaseId}&project=${project}`" x-text="doc.$id">

                                            <template x-for="attr in attributes">

                                                    <a :href="`/console/databases/document?id=${doc.$id}&collection=${doc.$collection}&databaseId=${databaseId}&project=${project}`">

                                            </template>

                                    </template>

                        <form
                            data-service="databases.listDocuments"
                            data-event="submit"
                            data-param-database-id="{{router.params.databaseId}}"
                            data-param-collection-id="{{router.params.id}}"
                            data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                            data-param-order-types="DESC"
                            data-param-order-types-cast-to="array"
                            data-scope="sdk"
                            data-name="project-documents"
                            data-success="state"
                            data-success-param-state-keys="search,offset">
                            <button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-documents.total}}" class="margin-end round small" aria-label="Back"></button>
                        </form>

                        <form
                            data-service="databases.listDocuments"
                            data-event="submit"
                            data-param-database-id="{{router.params.databaseId}}"
                            data-param-collection-id="{{router.params.id}}"
                            data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                            data-param-order-types="DESC"
                            data-param-order-types-cast-to="array"
                            data-scope="sdk"
                            data-name="project-documents"
                            data-success="state"
                            data-success-param-state-keys="search,offset">
                            <button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-documents.total}}" class="margin-start round small" aria-label="Next"></button>
                        </form>

                    <a data-ls-if="0 < {{project-collection.attributes.length}}" data-ls-attrs="href=/console/databases/document/new?collection={{router.params.id}}&databaseId={{router.params.databaseId}}&project={{router.params.project}}" class="button">
                        Add Document

                        Create Attribute

Attributes

No Attributes Found

Add your first attribute to get started

                    <table class="vertical" data-ls-if="0 < {{project-collection.attributes.length}}">

                                Attribute ID
                                Type

                                    available
                                    processing
                                    failed
                                    deleting
                                    stuck

                                    required

                                        <button type="button" class="close pull-end" data-ui-modal-close=""></button>

                                            <form>

                                                    Key

                                                        <input type="text" data-ls-bind="{{attribute.key}}" data-forms-copy disabled />

                                                    Type
                                                    <input type="text" data-ls-bind="{{attribute.type}}" disabled />

                                                        Format
                                                        <input type="text" data-ls-bind="{{attribute.format}}" class="full-width" disabled />

                                                            Required
                                                            <input type="text" data-ls-bind="{{attribute.required}}" disabled />

                                                            Array
                                                            <input type="text" data-ls-bind="{{attribute.array}}" disabled />

                                                        Default Value
                                                        <input type="text" data-ls-bind="{{attribute.default}}" class="full-width" disabled />

                                                        Length
                                                        <input type="text" data-ls-bind="{{attribute.size}}" class="full-width" disabled />

                                                        Elements

                                                            <input type="text" data-ls-bind="{{element}}" class="full-width" disabled />

                                                            Min
                                                            <input type="text" name="min" data-ls-bind="{{attribute.min}}" class="full-width" disabled />

                                                            Max
                                                            <input type="text" name="max" data-ls-bind="{{attribute.max}}" class="full-width" disabled />

                                            </form>

                                            <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
                                            <form
                                                data-ls-if="{{attribute.status}} !== 'deleting'"
                                                class="pull-end"
                                                data-analytics
                                                data-analytics-activity
                                                data-analytics-event="submit"
                                                data-analytics-category="console"
                                                data-analytics-label="Delete Collection Attribute"
                                                data-service="databases.deleteAttribute"
                                                data-scope="sdk"
                                                data-event="submit"
                                                data-confirm="Are you sure you want to delete this attribute?"
                                                data-param-database-id="{{router.params.databaseId}}"
                                                data-success="alert,trigger"
                                                data-success-param-alert-text="Deleted attribute successfully"
                                                data-success-param-trigger-events="databases.deleteAttribute"
                                                data-failure="alert"
                                                data-failure-param-alert-text="Failed to delete attribute"
                                                data-failure-param-alert-classname="error">

                                                <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
                                                <input type="hidden" name="collectionId" data-ls-bind="{{project-collection.$id}}" />
                                                <input type="hidden" name="key" data-ls-bind="{{attribute.key}}" />

                                                <button class="danger">Delete</button>
                                            </form>

 New String Attribute

 New Integer Attribute

 New Float Attribute

 New Boolean Attribute

 New URL Attribute

 New Email Attribute

 New IP Attribute

 New Enum Attribute

Indexes

No Indexes Found

Add your first index to get started

                    <table class="vertical multi-line" data-ls-if="0 < {{project-collection.indexes.length}}">

                                Index Key
                                Type
                                Attributes

                                    available
                                    processing
                                    failed
                                    deleting
                                    stuck

                                    []

                                    required

                                    <form
                                        data-ls-if="{{index.status}} !== 'deleting'"
                                        class="pull-end"
                                        data-analytics
                                        data-analytics-activity
                                        data-analytics-event="submit"
                                        data-analytics-category="console"
                                        data-analytics-label="Delete Collection Index"
                                        data-service="databases.deleteIndex"
                                        data-scope="sdk"
                                        data-event="submit"
                                        data-confirm="Are you sure you want to delete this index?"
                                        data-param-database-id="{{router.params.databaseId}}"
                                        data-success="alert,trigger"
                                        data-success-param-alert-text="Deleted index successfully"
                                        data-success-param-trigger-events="databases.deleteIndex"
                                        data-failure="alert"
                                        data-failure-param-alert-text="Failed to delete index"
                                        data-failure-param-alert-classname="error">

                                        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
                                        <input type="hidden" name="collectionId" data-ls-bind="{{project-collection.$id}}" />
                                        <input type="hidden" name="key" data-ls-bind="{{index.key}}" />

                                        <button class="danger small">Delete</button>
                                    </form>

                <button class="new-index">Add Index</button>

Activity

                <?php echo $logs->render(); ?>

                <form
                    class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '90d'"
                    data-service="databases.getCollectionUsage"
                    data-event="submit"
                    data-name="usage"
                    data-param-collection-id="{{router.params.id}}"
                    data-param-database-id="{{router.params.databaseId}}"
                    data-param-range="90d">
                    <button class="tick">90d</button>
                </form>

                <button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '90d'" disabled>90d</button>

                <form
                    class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '30d'"
                    data-service="databases.getCollectionUsage"
                    data-event="submit"
                    data-name="usage"
                    data-param-database-id="{{router.params.databaseId}}"
                    data-param-collection-id="{{router.params.id}}">
                    <button class="tick">30d</button>
                </form>

                <button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '30d'" disabled>30d</button>

                <form
                    class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '24h'"
                    data-service="databases.getCollectionUsage"
                    data-event="submit"
                    data-name="usage"
                    data-param-database-id="{{router.params.databaseId}}"
                    data-param-collection-id="{{router.params.id}}"
                    data-param-range="24h">
                    <button class="tick">24h</button>
                </form>

                <button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '24h'" disabled>24h</button>

Usage

Documents

Count of documents over time

                                <input type="hidden" data-ls-bind="{{usage}}" data-forms-chart="Documents=documentsCount" data-show-y-axis="true" data-height="140" />

Documents

Operations

Count of documents create, read, update and delete operations over time

                                <input
                                    type="hidden"
                                    data-ls-bind="{{usage}}"
                                    data-forms-chart="Created=documentsCreate,Read=documentsRead,Updated=documentsUpdate,Deleted=documentsDelete"
                                    data-show-y-axis="true"
                                    data-colors="create,read,update,delete"
                                    data-height="140" />

Created

Read

Updated

Deleted

Settings

                        <form id="permissions"></form>

                        <form
                            data-analytics
                            data-analytics-activity
                            data-analytics-event="submit"
                            data-analytics-category="console"
                            data-analytics-label="Update Database Collection"
                            data-service="databases.updateCollection"
                            data-scope="sdk"
                            data-event="submit"
                            data-param-collection-id="{{router.params.id}}"
                            data-param-database-id="{{router.params.databaseId}}"
                            data-success="alert,trigger"
                            data-success-param-alert-text="Updated collection successfully"
                            data-success-param-trigger-events="databases.updateCollection"
                            data-failure="alert"
                            data-failure-param-alert-text="Failed to update collection"
                            data-failure-param-alert-classname="error">

                                Name
                                <input name="name" id="collection-name" type="text" autocomplete="off" data-ls-bind="{{project-collection.name}}" data-forms-text-direction required placeholder="Collection Name" maxlength="128" />

                                    <input name="enabled" type="hidden" data-forms-switch data-cast-to="boolean" data-ls-bind="{{project-collection.enabled}}" />   Enabled

                                Permissions

Configure the permissions for this collection.

                                <?php echo $permissions->render(); ?>

                                Document Security

<input name="documentSecurity" value="false" type="checkbox" class="margin-top-no" data-ls-bind="{{project-collection.documentSecurity}}" />

                                        Enabled

With Document Security enabled, users will be able to access documents for which they have been granted either Document or Collection permissions.

                                <button>Update</button>
                        </form>

                    Collection ID

                        <input id="id" type="text" autocomplete="off" placeholder="" data-ls-bind="{{project-collection.$id}}" disabled data-forms-copy class="margin-bottom-no" />

                    Database ID

                        <input type="text" autocomplete="off" placeholder="" data-ls-bind="{{router.params.databaseId}}" disabled data-forms-copy class="margin-bottom-no" />

                            <button data-ls-ui-trigger="open-json"
                                class="link text-size-small"
                                data-analytics
                                data-analytics-event="click"
                                data-analytics-category="console"
                                data-analytics-label="View as JSON (Collection)">
                                View as JSON
                            </button>

 Last Updated:

 Created:

                        <form
                            name="databases.deleteCollection" class="margin-bottom"
                            data-analytics
                            data-analytics-activity
                            data-analytics-event="submit"
                            data-analytics-category="console"
                            data-analytics-label="Delete Database Collection"
                            data-service="databases.deleteCollection"
                            data-event="submit"
                            data-param-collection-id="{{router.params.id}}"
                            data-param-database-id="{{router.params.databaseId}}"
                            data-confirm="Are you sure you want to delete this collection?"
                            data-success="alert,trigger,redirect"
                            data-success-param-alert-text="Collection deleted successfully"
                            data-success-param-trigger-events="databases.deleteCollection"
                            data-success-param-redirect-url="/console/databases?project={{router.params.project}}"
                            data-failure="alert"
                            data-failure-param-alert-text="Failed to delete collection"
                            data-failure-param-alert-classname="error">

                        <button type="submit" class="danger fill">Delete Collection</button>
                    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add String Attribute

    <form
        id="add-string-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (string)"
        data-service="databases.createStringAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false, size: null }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />

        Attribute ID
        <input id="string-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

        Size
        <input id="string-length" name="size" type="number" class="margin-bottom" autocomplete="off" required value="255" data-cast-to="integer" x-model="size" />

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off" :maxlength="size">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Integer Attribute

    <form
        id="add-integer-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (integer)"
        data-service="databases.createIntegerAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false, min: null, max: null }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="integer-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

                Min
                <input id="integer-min" type="number" step="1" class="full-width" name="min" autocomplete="off" data-cast-to="integer" x-model="min" />

                Max
                <input id="integer-max" type="number" step="1" class="full-width" name="max" autocomplete="off" data-cast-to="integer" x-model="max" />

        Default Value

        <template x-if="!(array || required)">
            <input name="xdefault" type="number" class="margin-bottom-large" autocomplete="off" data-cast-to="integer" :min="min" :max="max">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="number" class="margin-bottom-large" autocomplete="off" data-cast-to="integer" disabled>
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Float Attribute

    <form
        id="add-float-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (float)"
        data-service="databases.createFloatAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false, min: null, max: null }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="float-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

                Min
                <input id="float-min" type="number" class="full-width" name="min" step="any" autocomplete="off" data-cast-to="float" x-model="min" />

                Max
                <input id="float-max" type="number" class="full-width" name="max" step="any" autocomplete="off" data-cast-to="float" x-model="max" />

        Default Value

        <template x-if="!(array || required)">
            <input name="xdefault" type="number" step="any" class="margin-bottom-large" autocomplete="off" data-cast-to="float" :min="min" :max="max">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="number" step="any" class="margin-bottom-large" autocomplete="off" data-cast-to="float" disabled>
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Email Attribute

    <form
        id="add-email-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (email)"
        data-service="databases.createEmailAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="email-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="128" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="email" class="margin-bottom-large" autocomplete="off">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="email" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Boolean Attribute

    <form
        id="add-boolean-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (boolean)"
        data-service="databases.createBooleanAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="boolean-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

            <template x-if="!(array || required)">
                <input name="xdefault" class="button switch" type="checkbox" />
            </template>
            <template x-if="(array || required)">
                <input name="" class="button switch" type="checkbox" disabled />
            </template>
              Default Value

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add IP Attribute

    <form
        id="add-ip-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (IP)"
        data-service="databases.createIpAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="ip-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add URL Attribute

    <form
        id="add-url-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (url)"
        data-service="databases.createUrlAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="url-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="url" class="margin-bottom-large" autocomplete="off">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="url" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Enum Attribute

    <form
        id="add-enum-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (enum)"
        data-service="databases.createEnumAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="enum-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

        Elements

                        <input data-cast-to="array" type="text" class="full-width" name="elements" required autocomplete="off" maxlength="128" />

                        <button type="button" data-remove class="dark danger small round pull-end" style="margin-top: 10px;"></button>

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Index

No Attributes Found

Please add your first attribute before adding your first index.

        <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    <form
        data-ls-if="0 < {{project-collection.attributes.length}}"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Index"
        data-service="databases.createIndex"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new index successfully"
        data-success-param-trigger-events="databases.createIndex"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create index"
        data-failure-param-alert-classname="error">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Index Key
        <input id="index-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

        Type
        <select id="index-type" name="type">
            <option value="key">Key</option>
            <option value="unique">Unique</option>
            <option value="fulltext">Fulltext</option>
        </select>

        Attributes

                        <select data-duplications data-ls-attrs="name=attributes" data-cast-to="array" class="margin-bottom-no">
                            <optgroup label="Internal">
                                <option value="$id">$id</option>
                                <option value="$createdAt">$createdAt</option>
                                <option value="$updatedAt">$updatedAt</option>
                            </optgroup>
                            <optgroup label="Attributes" data-ls-loop="project-collection.attributes" data-ls-as="option">
                                <option data-ls-attrs="value={{option.key}}" data-ls-bind="{{option.key}}"></option>
                            </optgroup>
                        </select>

                        <select name="orders" data-cast-to="array" class="margin-bottom-no">
                            <option value="ASC">ASC</option>
                            <option value="DESC">DESC</option>
                        </select>

                        <button type="button" data-remove class="dark danger small round pull-end" style="margin-top: 10px;"></button>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>


import * as sdk from "https://deno.land/x/appwrite/mod.ts";

// Init SDK
let client = new sdk.Client();

let locale = new sdk.Locale(client);

client
    .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
    .setProject('5df5acd0d48c2') // Your project ID
    .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

let promise = locale.get();

promise.then(function (response) {
    console.log(response);
}, function (error) {
    console.log(error);
});


appwrite teams updateMembershipRoles \
        --teamId="[TEAM_ID]" \
        --membershipId="[MEMBERSHIP_ID]" \
        --roles=""


const sdk = require('node-appwrite');

// Init SDK
let client = new sdk.Client();

let database = new sdk.Database(client);

client
    .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
    .setProject('5df5acd0d48c2') // Your project ID
    .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

let promise = database.getCollection('[COLLECTION_ID]');

promise.then(function (response) {
    console.log(response);
}, function (error) {
    console.log(error);
});


import io.appwrite.Client
import io.appwrite.services.Avatars

suspend fun main() {
    val client = Client(context)
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key

    val avatars = Avatars(client)
    val result = avatars.getCreditCard(
        code = "amex",
    )
    println(result); // Resource URL
}


const sdk = require('node-appwrite');

// Init SDK
let client = new sdk.Client();

let avatars = new sdk.Avatars(client);

client
    .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
    .setProject('5df5acd0d48c2') // Your project ID
    .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

let promise = avatars.getCreditCard('amex');

promise.then(function (response) {
    console.log(response);
}, function (error) {
    console.log(error);
});


import Appwrite

func main() {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...") // Your secret JSON Web Token

    let account = Account(client)
    account.createVerification(
        url: "https://example.com"
    ) { result in
        switch result {
        case .failure(let error):
            print(error.message)
        case .success(let token):
            print(String(describing: token)
        }
    }
}


<?php

use Utopia\Database\Database;

$method = $this->getParam('method', '');
$params = $this->getParam('params', []);
$events = $this->getParam('events', '');
$data = $this->getParam('data', '');
$permissions = $this->getParam('permissions', Database::PERMISSIONS);

$escapedPermissions = \array_map(function ($perm) {
    // Alpine won't bind to a parameter named delete :/
    if ($perm == 'delete') {
        return 'xdelete';
    }
    return $perm;
}, $permissions);

?>
<div
    <?php if ($method): ?>
        data-method="<?php echo $method; ?>"
    <?php endif; ?>
    <?php foreach ($params as $key => $value): ?>
        data-param-<?php echo $key; ?>="<?php echo $value; ?>"
    <?php endforeach; ?>
    data-scope="sdk"
    data-event="load<?php if (!empty($events)) echo ',' . $events; ?>"
    data-name="<?php echo $data; ?>"
    class="permissions-matrix margin-bottom-large"
    x-data="permissionsMatrix">

    <input
        type="hidden"
        name="permissions"
        data-cast-from="csv"
        data-cast-to="array"
        data-ls-bind="{{<?php echo $data ?>.$permissions}}"
        :value="rawPermissions"/>

    <table data-ls-attrs="x-init=load({{<?php echo $data ?>.$permissions}})">

            Role
            <?php foreach ($permissions as $permission): ?>
                <?php echo \ucfirst($permission); ?>
            <?php endforeach; ?>

        <template x-for="(permission, index) in permissions">

                <?php foreach ($escapedPermissions as $permission): ?>

                        <input
                            type="checkbox"
                            name="<?php echo $permission ?>"
                            x-model="permission.<?php echo $permission; ?>"
                            @click="updatePermission(index)"/>

                <?php endforeach; ?>

        </template>
        <tr x-data="permissionsRow"
            @addrow.window="addPermission(role,<?php echo \implode(',', $escapedPermissions) ?>)">

                <datalist id="types">
                    <option value="user:">
                    <option value="team:">
                    <option value="users">
                    <option value="guests">
                    <option value="any">
                </datalist>

                <input required id="role" form="permissions" type="text" name="role" x-model="role" list="types"/>

            <?php foreach ($escapedPermissions as $permission): ?>

                    <input type="checkbox" name="<?php echo $permission ?>" x-model="<?php echo $permission; ?>"/>

            <?php endforeach; ?>

                <button type="button" class="btn btn-primary margin-top-small" @click="$dispatch('addrow')">Add</button>


import 'package:dart_appwrite/dart_appwrite.dart';

void main() { // Init SDK
  Client client = Client();
  Teams teams = Teams(client);

  client
    .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
    .setProject('5df5acd0d48c2') // Your project ID
    .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
  ;

  Future result = teams.createMembership(
    teamId: '[TEAM_ID]',
    email: 'email@example.com',
    roles: [],
    url: 'https://example.com',
  );

  result
    .then((response) {
      print(response);
    }).catchError((error) {
      print(error.response);
  });
}


import 'package:dart_appwrite/dart_appwrite.dart';

void main() { // Init SDK
  Client client = Client();
  Teams teams = Teams(client);

  client
    .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
    .setProject('5df5acd0d48c2') // Your project ID
    .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
  ;

  Future result = teams.get(
    teamId: '[TEAM_ID]',
  );

  result
    .then((response) {
      print(response);
    }).catchError((error) {
      print(error.response);
  });
}


import * as sdk from "https://deno.land/x/appwrite/mod.ts";

// Init SDK
let client = new sdk.Client();

let databases = new sdk.Databases(client, '[DATABASE_ID]');

client
    .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
    .setProject('5df5acd0d48c2') // Your project ID
    .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

let promise = databases.listAttributes('[COLLECTION_ID]');

promise.then(function (response) {
    console.log(response);
}, function (error) {
    console.log(error);
});


@addrow.window="addPermission(role,<?php echo \implode(',', $escapedPermissions) ?>)">

keep keep keep keep keep replace keep keep keep keep

@addrow.window="addPermission(<?php echo $form; ?>,role,{<?php echo \implode(',', $escapedPermissions) ?>})">


<?php

use Appwrite\Client;
use Appwrite\Services\Functions;

$client = new Client();

$client
    ->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
    ->setProject('5df5acd0d48c2') // Your project ID
    ->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;

$functions = new Functions($client);

$result = $functions->update('[FUNCTION_ID]', '[NAME]', []);


using Appwrite;

Client client = new Client();

client
  .SetEndPoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
  .SetProject("5df5acd0d48c2") // Your project ID
  .SetKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
;

Storage storage = new Storage(client);

HttpResponseMessage result = await storage.ListFiles();


require 'appwrite'

client = Appwrite::Client.new

client
    .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
    .set_project('5df5acd0d48c2') # Your project ID
    .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key

functions = Appwrite::Functions.new(client)

response = functions.delete_tag(function_id: '[FUNCTION_ID]', tag_id: '[TAG_ID]')

puts response.inspect


<input required id="role" form="permissions" type="text" name="role" x-model="role" list="types"/>

<?php foreach ($escapedPermissions as $permission): ?>

<input type="checkbox" name="<?php echo $permission ?>" x-model="<?php echo $permission; ?>"/>

keep keep keep keep replace keep keep keep keep keep


import * as sdk from "https://deno.land/x/appwrite/mod.ts";

// Init SDK
let client = new sdk.Client();

let account = new sdk.Account(client);

client
    .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
    .setProject('5df5acd0d48c2') // Your project ID
    .setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
;

let promise = account.get();

promise.then(function (response) {
    console.log(response);
}, function (error) {
    console.log(error);
});


from appwrite.client import Client
from appwrite.services.database import Database

client = Client()

(client
  .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
  .set_project('5df5acd0d48c2') # Your project ID
  .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
)

database = Database(client)

result = database.update_document('[COLLECTION_ID]', '[DOCUMENT_ID]', {})


import 'package:dart_appwrite/dart_appwrite.dart';

void main() { // Init SDK
  Client client = Client();
  Health health = Health(client);

  client
    .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
    .setProject('5df5acd0d48c2') // Your project ID
    .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
  ;

  Future result = health.getQueueCertificates();

  result
    .then((response) {
      print(response);
    }).catchError((error) {
      print(error.response);
  });
}


<div class="row responsive margin-top-negative">

keep keep keep keep replace replace keep keep keep keep keep

<?php

$logs = $this->getParam('logs', null);
$permissions = $this->getParam('permissions', null);

?>

        <button type="button" class="close pull-end" data-ui-modal-close=""></button>

JSON View

            <input type="hidden" data-ls-bind="{{project-collection}}" data-forms-code />

        <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

Documents

                <div
                    data-service="databases.listDocuments"
                    data-event="load,databases.createDocument,databases.updateDocument,databases.deleteDocument"
                    data-param-collection-id="{{router.params.id}}"
                    data-param-database-id="{{router.params.databaseId}}"
                    data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                    data-param-order-types="DESC"
                    data-param-order-types-cast-to="array"
                    data-scope="sdk"
                    data-name="project-documents"
                    x-data="{ project: new URLSearchParams(location.search).get('project') }">

No Documents Found

Add your first document to get started

<span data-ls-if="{{project-documents.total}} == <?php echo APP_LIMIT_COUNT; ?>">+ documents found

                                        $id
                                        <template x-for="attr in attributes">

                                                []

                                        </template>

                                    <template x-for="doc in documents">

                                                <a :href="`/console/databases/document?id=${doc.$id}&collection=${doc.$collection}&databaseId=${databaseId}&project=${project}`" x-text="doc.$id">

                                            <template x-for="attr in attributes">

                                                    <a :href="`/console/databases/document?id=${doc.$id}&collection=${doc.$collection}&databaseId=${databaseId}&project=${project}`">

                                            </template>

                                    </template>

                        <form
                            data-service="databases.listDocuments"
                            data-event="submit"
                            data-param-database-id="{{router.params.databaseId}}"
                            data-param-collection-id="{{router.params.id}}"
                            data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                            data-param-order-types="DESC"
                            data-param-order-types-cast-to="array"
                            data-scope="sdk"
                            data-name="project-documents"
                            data-success="state"
                            data-success-param-state-keys="search,offset">
                            <button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-total="{{project-documents.total}}" class="margin-end round small" aria-label="Back"></button>
                        </form>

                        <form
                            data-service="databases.listDocuments"
                            data-event="submit"
                            data-param-database-id="{{router.params.databaseId}}"
                            data-param-collection-id="{{router.params.id}}"
                            data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
                            data-param-order-types="DESC"
                            data-param-order-types-cast-to="array"
                            data-scope="sdk"
                            data-name="project-documents"
                            data-success="state"
                            data-success-param-state-keys="search,offset">
                            <button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-total="{{project-documents.total}}" class="margin-start round small" aria-label="Next"></button>
                        </form>

                    <a data-ls-if="0 < {{project-collection.attributes.length}}" data-ls-attrs="href=/console/databases/document/new?collection={{router.params.id}}&databaseId={{router.params.databaseId}}&project={{router.params.project}}" class="button">
                        Add Document

                        Create Attribute

Attributes

No Attributes Found

Add your first attribute to get started

                    <table class="vertical" data-ls-if="0 < {{project-collection.attributes.length}}">

                                Attribute ID
                                Type

                                    available
                                    processing
                                    failed
                                    deleting
                                    stuck

                                    required

                                        <button type="button" class="close pull-end" data-ui-modal-close=""></button>

                                            <form>

                                                    Key

                                                        <input type="text" data-ls-bind="{{attribute.key}}" data-forms-copy disabled />

                                                    Type
                                                    <input type="text" data-ls-bind="{{attribute.type}}" disabled />

                                                        Format
                                                        <input type="text" data-ls-bind="{{attribute.format}}" class="full-width" disabled />

                                                            Required
                                                            <input type="text" data-ls-bind="{{attribute.required}}" disabled />

                                                            Array
                                                            <input type="text" data-ls-bind="{{attribute.array}}" disabled />

                                                        Default Value
                                                        <input type="text" data-ls-bind="{{attribute.default}}" class="full-width" disabled />

                                                        Length
                                                        <input type="text" data-ls-bind="{{attribute.size}}" class="full-width" disabled />

                                                        Elements

                                                            <input type="text" data-ls-bind="{{element}}" class="full-width" disabled />

                                                            Min
                                                            <input type="text" name="min" data-ls-bind="{{attribute.min}}" class="full-width" disabled />

                                                            Max
                                                            <input type="text" name="max" data-ls-bind="{{attribute.max}}" class="full-width" disabled />

                                            </form>

                                            <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
                                            <form
                                                data-ls-if="{{attribute.status}} !== 'deleting'"
                                                class="pull-end"
                                                data-analytics
                                                data-analytics-activity
                                                data-analytics-event="submit"
                                                data-analytics-category="console"
                                                data-analytics-label="Delete Collection Attribute"
                                                data-service="databases.deleteAttribute"
                                                data-scope="sdk"
                                                data-event="submit"
                                                data-confirm="Are you sure you want to delete this attribute?"
                                                data-param-database-id="{{router.params.databaseId}}"
                                                data-success="alert,trigger"
                                                data-success-param-alert-text="Deleted attribute successfully"
                                                data-success-param-trigger-events="databases.deleteAttribute"
                                                data-failure="alert"
                                                data-failure-param-alert-text="Failed to delete attribute"
                                                data-failure-param-alert-classname="error">

                                                <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
                                                <input type="hidden" name="collectionId" data-ls-bind="{{project-collection.$id}}" />
                                                <input type="hidden" name="key" data-ls-bind="{{attribute.key}}" />

                                                <button class="danger">Delete</button>
                                            </form>

 New String Attribute

 New Integer Attribute

 New Float Attribute

 New Boolean Attribute

 New URL Attribute

 New Email Attribute

 New IP Attribute

 New Enum Attribute

Indexes

No Indexes Found

Add your first index to get started

                    <table class="vertical multi-line" data-ls-if="0 < {{project-collection.indexes.length}}">

                                Index Key
                                Type
                                Attributes

                                    available
                                    processing
                                    failed
                                    deleting
                                    stuck

                                    []

                                    required

                                    <form
                                        data-ls-if="{{index.status}} !== 'deleting'"
                                        class="pull-end"
                                        data-analytics
                                        data-analytics-activity
                                        data-analytics-event="submit"
                                        data-analytics-category="console"
                                        data-analytics-label="Delete Collection Index"
                                        data-service="databases.deleteIndex"
                                        data-scope="sdk"
                                        data-event="submit"
                                        data-confirm="Are you sure you want to delete this index?"
                                        data-param-database-id="{{router.params.databaseId}}"
                                        data-success="alert,trigger"
                                        data-success-param-alert-text="Deleted index successfully"
                                        data-success-param-trigger-events="databases.deleteIndex"
                                        data-failure="alert"
                                        data-failure-param-alert-text="Failed to delete index"
                                        data-failure-param-alert-classname="error">

                                        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
                                        <input type="hidden" name="collectionId" data-ls-bind="{{project-collection.$id}}" />
                                        <input type="hidden" name="key" data-ls-bind="{{index.key}}" />

                                        <button class="danger small">Delete</button>
                                    </form>

                <button class="new-index">Add Index</button>

Activity

                <?php echo $logs->render(); ?>

                <form
                    class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '90d'"
                    data-service="databases.getCollectionUsage"
                    data-event="submit"
                    data-name="usage"
                    data-param-collection-id="{{router.params.id}}"
                    data-param-database-id="{{router.params.databaseId}}"
                    data-param-range="90d">
                    <button class="tick">90d</button>
                </form>

                <button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '90d'" disabled>90d</button>

                <form
                    class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '30d'"
                    data-service="databases.getCollectionUsage"
                    data-event="submit"
                    data-name="usage"
                    data-param-database-id="{{router.params.databaseId}}"
                    data-param-collection-id="{{router.params.id}}">
                    <button class="tick">30d</button>
                </form>

                <button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '30d'" disabled>30d</button>

                <form
                    class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '24h'"
                    data-service="databases.getCollectionUsage"
                    data-event="submit"
                    data-name="usage"
                    data-param-database-id="{{router.params.databaseId}}"
                    data-param-collection-id="{{router.params.id}}"
                    data-param-range="24h">
                    <button class="tick">24h</button>
                </form>

                <button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '24h'" disabled>24h</button>

Usage

Documents

Count of documents over time

                                <input type="hidden" data-ls-bind="{{usage}}" data-forms-chart="Documents=documentsCount" data-show-y-axis="true" data-height="140" />

Documents

Operations

Count of documents create, read, update and delete operations over time

                                <input
                                    type="hidden"
                                    data-ls-bind="{{usage}}"
                                    data-forms-chart="Created=documentsCreate,Read=documentsRead,Updated=documentsUpdate,Deleted=documentsDelete"
                                    data-show-y-axis="true"
                                    data-colors="create,read,update,delete"
                                    data-height="140" />

Created

Read

Updated

Deleted

Settings

                        <form id="permissions"></form>

                        <form
                            data-analytics
                            data-analytics-activity
                            data-analytics-event="submit"
                            data-analytics-category="console"
                            data-analytics-label="Update Database Collection"
                            data-service="databases.updateCollection"
                            data-scope="sdk"
                            data-event="submit"
                            data-param-collection-id="{{router.params.id}}"
                            data-param-database-id="{{router.params.databaseId}}"
                            data-success="alert,trigger"
                            data-success-param-alert-text="Updated collection successfully"
                            data-success-param-trigger-events="databases.updateCollection"
                            data-failure="alert"
                            data-failure-param-alert-text="Failed to update collection"
                            data-failure-param-alert-classname="error">

                                Name
                                <input name="name" id="collection-name" type="text" autocomplete="off" data-ls-bind="{{project-collection.name}}" data-forms-text-direction required placeholder="Collection Name" maxlength="128" />

                                    <input name="enabled" type="hidden" data-forms-switch data-cast-to="boolean" data-ls-bind="{{project-collection.enabled}}" />   Enabled

                                Permissions

Configure the permissions for this collection.

                                <?php echo $permissions->render(); ?>

                                Document Security

<input name="documentSecurity" value="false" type="checkbox" class="margin-top-no" data-ls-bind="{{project-collection.documentSecurity}}" />

                                        Enabled

With Document Security enabled, users will be able to access documents for which they have been granted either Document or Collection permissions.

                                <button>Update</button>
                        </form>

                    Collection ID

                        <input id="id" type="text" autocomplete="off" placeholder="" data-ls-bind="{{project-collection.$id}}" disabled data-forms-copy class="margin-bottom-no" />

                    Database ID

                        <input type="text" autocomplete="off" placeholder="" data-ls-bind="{{router.params.databaseId}}" disabled data-forms-copy class="margin-bottom-no" />

                            <button data-ls-ui-trigger="open-json"
                                class="link text-size-small"
                                data-analytics
                                data-analytics-event="click"
                                data-analytics-category="console"
                                data-analytics-label="View as JSON (Collection)">
                                View as JSON
                            </button>

 Last Updated:

 Created:

                        <form
                            name="databases.deleteCollection" class="margin-bottom"
                            data-analytics
                            data-analytics-activity
                            data-analytics-event="submit"
                            data-analytics-category="console"
                            data-analytics-label="Delete Database Collection"
                            data-service="databases.deleteCollection"
                            data-event="submit"
                            data-param-collection-id="{{router.params.id}}"
                            data-param-database-id="{{router.params.databaseId}}"
                            data-confirm="Are you sure you want to delete this collection?"
                            data-success="alert,trigger,redirect"
                            data-success-param-alert-text="Collection deleted successfully"
                            data-success-param-trigger-events="databases.deleteCollection"
                            data-success-param-redirect-url="/console/databases?project={{router.params.project}}"
                            data-failure="alert"
                            data-failure-param-alert-text="Failed to delete collection"
                            data-failure-param-alert-classname="error">

                        <button type="submit" class="danger fill">Delete Collection</button>
                    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add String Attribute

    <form
        id="add-string-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (string)"
        data-service="databases.createStringAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false, size: null }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />

        Attribute ID
        <input id="string-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

        Size
        <input id="string-length" name="size" type="number" class="margin-bottom" autocomplete="off" required value="255" data-cast-to="integer" x-model="size" />

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off" :maxlength="size">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Integer Attribute

    <form
        id="add-integer-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (integer)"
        data-service="databases.createIntegerAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false, min: null, max: null }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="integer-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

                Min
                <input id="integer-min" type="number" step="1" class="full-width" name="min" autocomplete="off" data-cast-to="integer" x-model="min" />

                Max
                <input id="integer-max" type="number" step="1" class="full-width" name="max" autocomplete="off" data-cast-to="integer" x-model="max" />

        Default Value

        <template x-if="!(array || required)">
            <input name="xdefault" type="number" class="margin-bottom-large" autocomplete="off" data-cast-to="integer" :min="min" :max="max">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="number" class="margin-bottom-large" autocomplete="off" data-cast-to="integer" disabled>
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Float Attribute

    <form
        id="add-float-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (float)"
        data-service="databases.createFloatAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false, min: null, max: null }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="float-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

                Min
                <input id="float-min" type="number" class="full-width" name="min" step="any" autocomplete="off" data-cast-to="float" x-model="min" />

                Max
                <input id="float-max" type="number" class="full-width" name="max" step="any" autocomplete="off" data-cast-to="float" x-model="max" />

        Default Value

        <template x-if="!(array || required)">
            <input name="xdefault" type="number" step="any" class="margin-bottom-large" autocomplete="off" data-cast-to="float" :min="min" :max="max">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="number" step="any" class="margin-bottom-large" autocomplete="off" data-cast-to="float" disabled>
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Email Attribute

    <form
        id="add-email-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (email)"
        data-service="databases.createEmailAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="email-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="128" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="email" class="margin-bottom-large" autocomplete="off">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="email" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Boolean Attribute

    <form
        id="add-boolean-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (boolean)"
        data-service="databases.createBooleanAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="boolean-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

            <template x-if="!(array || required)">
                <input name="xdefault" class="button switch" type="checkbox" />
            </template>
            <template x-if="(array || required)">
                <input name="" class="button switch" type="checkbox" disabled />
            </template>
              Default Value

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add IP Attribute

    <form
        id="add-ip-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (IP)"
        data-service="databases.createIpAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="ip-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add URL Attribute

    <form
        id="add-url-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (url)"
        data-service="databases.createUrlAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="url-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="url" class="margin-bottom-large" autocomplete="off">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="url" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Enum Attribute

    <form
        id="add-enum-attribute"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Attribute (enum)"
        data-service="databases.createEnumAttribute"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new attribute successfully"
        data-success-param-trigger-events="databases.createAttribute"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create attribute"
        data-failure-param-alert-classname="error"
        @reset="array = required = false"
        x-data="{ array: false, required: false }">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Attribute ID
        <input id="enum-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

        Elements

                        <input data-cast-to="array" type="text" class="full-width" name="elements" required autocomplete="off" maxlength="128" />

                        <button type="button" data-remove class="dark danger small round pull-end" style="margin-top: 10px;"></button>

            <input x-model="required" name="required" class="button switch" type="checkbox" />   Required

            <input x-model="array" name="array" class="button switch" type="checkbox" />   Array

        Default Value
        <template x-if="!(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off">
        </template>
        <template x-if="(array || required)">
            <input name="xdefault" type="text" class="margin-bottom-large" autocomplete="off" disabled value="">
        </template>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>

    <button type="button" class="close pull-end" data-ui-modal-close=""></button>

Add Index

No Attributes Found

Please add your first attribute before adding your first index.

        <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    <form
        data-ls-if="0 < {{project-collection.attributes.length}}"
        data-analytics
        data-analytics-activity
        data-analytics-event="submit"
        data-analytics-category="console"
        data-analytics-label="Create Collection Index"
        data-service="databases.createIndex"
        data-scope="sdk"
        data-event="submit"
        data-success="alert,trigger,reset"
        data-success-param-alert-text="Created new index successfully"
        data-success-param-trigger-events="databases.createIndex"
        data-failure="alert"
        data-failure-param-alert-text="Failed to create index"
        data-failure-param-alert-classname="error">

        <input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
        <input type="hidden" name="databaseId" data-ls-bind="{{router.params.databaseId}}" />
        <input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />

        Index Key
        <input id="index-key" type="text" class="full-width" name="key" required autocomplete="off" maxlength="36" pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]{0,35}$" />

Allowed Characters A-Z, a-z, 0-9, and non-leading underscore, hyphen and dot

        Type
        <select id="index-type" name="type">
            <option value="key">Key</option>
            <option value="unique">Unique</option>
            <option value="fulltext">Fulltext</option>
        </select>

        Attributes

                        <select data-duplications data-ls-attrs="name=attributes" data-cast-to="array" class="margin-bottom-no">
                            <optgroup label="Internal">
                                <option value="$id">$id</option>
                                <option value="$createdAt">$createdAt</option>
                                <option value="$updatedAt">$updatedAt</option>
                            </optgroup>
                            <optgroup label="Attributes" data-ls-loop="project-collection.attributes" data-ls-as="option">
                                <option data-ls-attrs="value={{option.key}}" data-ls-bind="{{option.key}}"></option>
                            </optgroup>
                        </select>

                        <select name="orders" data-cast-to="array" class="margin-bottom-no">
                            <option value="ASC">ASC</option>
                            <option value="DESC">DESC</option>
                        </select>

                        <button type="button" data-remove class="dark danger small round pull-end" style="margin-top: 10px;"></button>

            <button type="submit">Create</button>   <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>

    </form>


import 'package:dart_appwrite/dart_appwrite.dart';

void main() { // Init SDK
  Client client = Client();
  Database database = Database(client);

  client
    .setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
    .setProject('5df5acd0d48c2') // Your project ID
    .setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
  ;

  Future result = database.createDocument(
    collectionId: '[COLLECTION_ID]',
    data: {},
    read: [],
    write: [],
  );

  result
    .then((response) {
      print(response);
    }).catchError((error) {
      print(error.response);
  });
}


import Appwrite

func main() async throws {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
    let teams = Teams(client)
    let membershipList = try await teams.getMemberships(
        teamId: "[TEAM_ID]"
    )

    print(String(describing: membershipList)
}


import io.appwrite.Client
import io.appwrite.services.Database

suspend fun main() {
    val client = Client(context)
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key

    val database = Database(client)
    val response = database.getCollection(
        collectionId = "[COLLECTION_ID]"
    )
    val json = response.body?.string()
}