Query.equal() not working as expected? (Svelte,Typescript, Appwrite Cloud)
- 0
- Users
- Databases
- Web
- Cloud

I feel like I've overlooked something small, but it's now racking my brain, this code isn't returning what I need, which is documents belonging to just this one user who's signed in.
const userID = get(state).account!.$id;
const response = await sdk.database.listDocuments(server.database, server.collection, [Query.equal('ownerID',[userID]), Query.orderDesc('')]);

I have this import at the top of my page.
import { ID, Permission, Role, Query } from 'appwrite';
Not sure if i should be importing from node-appwrite
instead?

node-appwrite is for backend

Give more information. Wich version of appwrite, cloud or locally, wich version of sdk, etc..

To got document of user, you need to set permission

And assign permission when you create document


And enable document security on collection

I'll get you the versions of my environment shortly, the documents were created with the users permission, and I have document security enabled. Are you saying that a regular call to get the documents from the database will automatically fetch only the ones I have permission to? I don't need an additional Query filter?

You don't need if you enable document security yes

And connect via client sdk

Great, that worked. For me to allow another user permission to the same document, i would have to add their ID to the permissions array of the document?

Yes

You can also make a teams, add your 2 users on it, and add permission on this team
Recommended threads
- My projects archived. Did not see the up...
Kindly restore these two projects for me 66d6f4270037aafe3c39 and 663fdf520017d2d0f4e8 You can delete 66887997000e2c5b7e49
- Hello so after selecting the 2 projects ...
so here the project id of the two project 1: 662b832999f08a693c77 project 2 : 651de5a0d4c1158c8b2f
- The 2 projects selected DB showing proje...
So since there was a limit before 1 sept to select only two projects for free , I selected the two I wanted but the one of the selected one's DB is showing 402 ...
