Rank 1: Thread
Hello! I have tried to create a document but I keep getting the following error in my nodejs function
"UserEmailHere (role: users) missing scope (databases.read)"
I still get this error after creating the database and collection and setting permissions for the collection to "All Users". I also used the .setJWT(jwtToken). The collection ID is "1"
Here is my code:
const db = await database.createDocument("databaseIDHere",'1',ID.unique(),{
'clockIn':Date.now(),
'clockOut':Date.now()+new Date(2023,12,2,15),
'userId':user.$id
})
return res.json(JSON.stringify({ db }))
Thanks in advance