import {
Client,
Databases,
ID,
} from "https://deno.land/x/appwrite@7.0.0/mod.ts";
type Appwrite = {
endpoint: string;
project: string;
key: string;
self_signed: boolean;
};
export async function main(
auth: Appwrite,
database_id: string,
collection_id: string,
document_id: string,
document_data?: Record<string | number, any>,
document_permissions?: string[],
) {
const client = new Client()
.setEndpoint(auth.endpoint)
.setProject(auth.project)
.setKey(auth.key);
const db = new Databases(client);
return await db.updateDocument(
database_id,
collection_id,
document_id,
document_data,
document_permissions,
);
}
Submitted by admin 497 days ago
import { Client, Databases, ID } from "https://deno.land/x/appwrite@7.0.0/mod.ts";
type Appwrite = {
endpoint: string;
project: string;
key: string;
self_signed: boolean;
};
export async function main(
auth: Appwrite,
database_id: string,
collection_id: string,
document_id: string,
document_data?: Record<string | number, any>,
document_permissions?: string[]
) {
const client = new Client()
.setEndpoint(auth.endpoint)
.setProject(auth.project)
.setKey(auth.key)
const db = new Databases(client);
return await db.updateDocument(
database_id,
collection_id,
document_id,
document_data,
document_permissions
)
}
Submitted by admin 500 days ago
import { Resource } from "https://deno.land/x/windmill@v1.87.0/mod.ts"
import { Client, Databases, ID } from "https://deno.land/x/appwrite@7.0.0/mod.ts";
export async function main(
auth: Resource<'appwrite'>,
database_id: string,
collection_id: string,
document_id: string,
document_data?: Record<string | number, any>,
document_permissions?: string[]
) {
const client = new Client()
.setEndpoint(auth.endpoint)
.setProject(auth.project)
.setKey(auth.key)
const db = new Databases(client);
return await db.updateDocument(
database_id,
collection_id,
document_id,
document_data,
document_permissions
)
}
Submitted by adam186 614 days ago
import { Resource } from "https://deno.land/x/windmill@v1.87.0/mod.ts"
import { Client, Databases, ID } from "https://deno.land/x/appwrite@7.0.0/mod.ts";
/**
* @param document_id ID of the document to be created. Leave blank to generate a unique ID.
*/
export async function main(
auth: Resource<'appwrite'>,
database_id: string,
collection_id: string,
document_id: string,
document_data?: Record<string | number, any>,
document_permissions?: string[]
) {
const client = new Client()
.setEndpoint(auth.endpoint)
.setProject(auth.project)
.setKey(auth.key)
const db = new Databases(client);
return await db.updateDocument(
database_id,
collection_id,
document_id,
document_data,
document_permissions
)
}
Submitted by adam186 614 days ago