`import { Client } from 'node-appwrite';
export default async ({ req, res, log, error }) => { // Initialize Appwrite const client = new Client() .setEndpoint('api.example.com') .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID) .setKey(process.env.APPWRITE_API_KEY);
// Init database const database = new client.Databases(client)`
error: TypeError: client.Databases is not a constructor at Module.default (file:///usr/local/server/src/function/src/main.js:28:20) at execute (/usr/local/server/src/server.js:141:48) at async /usr/local/server/src/server.js:158:13
Function was made with the starter template.
Databases is not a valid constructor functions
Recommended threads
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...