Rank 2: Process
I'm getting the above error when I'm trying to call listDocuments inside a function. Aren't default clients using APPRITE_API_KEY in functions supposed to be able to make actions regardless of permissions? Or I'm doing something wrong?
Here is the function:
import { Client, Query, Databases } from 'node-appwrite'
const client = new Client()client .setEndpoint(process.env.APPWRITE_ENDPOINT) .setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID) .setKey(process.env.APPWRITE_API_KEY)
const db = new Databases(client)
export default async ({ req, res, log, error }) => { const results = await db.listDocuments('MYDB', 'Users', [Query.equal('UserID', req.body.userId)]) log(results) return res.send('ok')}