import { Databases } from "https://deno.land/x/appwrite@5.0.1/mod.ts";
Constructors
new
Databases(client: Client, databaseId: string)Methods
createBooleanAttribute(): Promise<Models.AttributeBoolean>
collectionId: string,
key: string,
required: boolean,
xdefault?: boolean,
array?: boolean,
Create Boolean Attribute
createCollection(): Promise<Models.Collection>
collectionId: string,
name: string,
permission: string,
read: string[],
write: string[],
Create Collection
createDocument<Document extends Models.Document>(): Promise<Document>
collectionId: string,
documentId: string,
data: object,
read?: string[],
write?: string[],
Create Document
createEmailAttribute(): Promise<Models.AttributeEmail>
collectionId: string,
key: string,
required: boolean,
xdefault?: string,
array?: boolean,
Create Email Attribute
createEnumAttribute(): Promise<Models.AttributeEnum>
collectionId: string,
key: string,
elements: string[],
required: boolean,
xdefault?: string,
array?: boolean,
Create Enum Attribute
createFloatAttribute(): Promise<Models.AttributeFloat>
collectionId: string,
key: string,
required: boolean,
min?: number,
max?: number,
xdefault?: number,
array?: boolean,
Create Float Attribute
createIndex(): Promise<Models.Index>
collectionId: string,
key: string,
type: string,
attributes: string[],
orders?: string[],
Create Index
createIntegerAttribute(): Promise<Models.AttributeInteger>
collectionId: string,
key: string,
required: boolean,
min?: number,
max?: number,
xdefault?: number,
array?: boolean,
Create Integer Attribute
createIpAttribute(): Promise<Models.AttributeIp>
collectionId: string,
key: string,
required: boolean,
xdefault?: string,
array?: boolean,
Create IP Address Attribute
createStringAttribute(): Promise<Models.AttributeString>
collectionId: string,
key: string,
size: number,
required: boolean,
xdefault?: string,
array?: boolean,
Create String Attribute
createUrlAttribute(): Promise<Models.AttributeUrl>
collectionId: string,
key: string,
required: boolean,
xdefault?: string,
array?: boolean,
Create URL Attribute
getDatabaseId(): string
getDocument<Document extends Models.Document>(collectionId: string, documentId: string): Promise<Document>
Get Document
list(): Promise<Models.DatabaseList>
search?: string,
limit?: number,
offset?: number,
cursor?: string,
cursorDirection?: string,
orderType?: string,
List Databases
listCollections(): Promise<Models.CollectionList>
search?: string,
limit?: number,
offset?: number,
cursor?: string,
cursorDirection?: string,
orderType?: string,
List Collections
listDocuments<Document extends Models.Document>(): Promise<Models.DocumentList<Document>>
collectionId: string,
queries?: string[],
limit?: number,
offset?: number,
cursor?: string,
cursorDirection?: string,
orderAttributes?: string[],
orderTypes?: string[],
List Documents
setDatabaseId(databaseId: string): void
updateCollection(): Promise<Models.Collection>
collectionId: string,
name: string,
permission: string,
read?: string[],
write?: string[],
enabled?: boolean,
Update Collection
updateDocument<Document extends Models.Document>(): Promise<Document>
collectionId: string,
documentId: string,
data?: object,
read?: string[],
write?: string[],
Update Document