Announcing the Appwrite OSS Fund, Learn More! 🤑
Docs

Collection Object

Properties

Name Type Description
$id string

Collection ID.

$read string[]

Collection read permissions.

$write string[]

Collection write permissions.

name string

Collection name.

enabled boolean

Collection enabled.

permission string

Collection permission model. Possible values: document or collection

attributes array of
attributeBoolean
attributeInteger
attributeFloat
attributeEmail
attributeEnum
attributeUrl
attributeIp
attributeString

Collection attributes.

indexes index[]

Collection indexes.

Examples

JSON

{
    "$id": "5e5ea5c16897e",
    "$read": [
        "role:all"
    ],
    "$write": [
        "user:608f9da25e7e1"
    ],
    "name": "My Collection",
    "enabled": false,
    "permission": "document",
    "attributes": [
        {
            "key": "isEnabled",
            "type": "boolean",
            "status": "available",
            "required": true,
            "array": false,
            "default": false
        },
        {
            "key": "count",
            "type": "integer",
            "status": "available",
            "required": true,
            "array": false,
            "min": 1,
            "max": 10,
            "default": 10
        },
        {
            "key": "percentageCompleted",
            "type": "double",
            "status": "available",
            "required": true,
            "array": false,
            "min": 1.5,
            "max": 10.5,
            "default": 2.5
        },
        {
            "key": "userEmail",
            "type": "string",
            "status": "available",
            "required": true,
            "array": false,
            "format": "email",
            "default": "default@example.com"
        },
        {
            "key": "status",
            "type": "string",
            "status": "available",
            "required": true,
            "array": false,
            "elements": [
                "element"
            ],
            "format": "enum",
            "default": "element"
        },
        {
            "key": "githubUrl",
            "type": "string",
            "status": "available",
            "required": true,
            "array": false,
            "format": "url",
            "default": "http:\/\/example.com"
        },
        {
            "key": "ipAddress",
            "type": "string",
            "status": "available",
            "required": true,
            "array": false,
            "format": "ip",
            "default": "192.0.2.0"
        },
        {
            "key": "fullName",
            "type": "string",
            "status": "available",
            "required": true,
            "array": false,
            "size": 128,
            "default": "default"
        }
    ],
    "indexes": {
        "key": "index1",
        "type": "primary",
        "status": "available",
        "attributes": [],
        "orders": []
    }
}