Back

[Solved] Query to get specific user documents using server sdk

  • 0
  • Databases
  • Web
Ajit Singh
3 Nov, 2023, 11:15

how can I get a specific user documents using server sdk. which query can I use

TL;DR
OP wants to use the server SDK to query for specific user documents. Someone suggests storing the user in an attribute and querying against that attribute. OP is creating a superuser who can see other users' documents and manage permissions. They want to check another DB attribute, which is why they are using the server SDK. Someone suggests using `.setJWT` in the server SDK. Another person mentions that server SDK uses API keys instead of JWT. OP asks how to get specific user documents using the server SDK and which query to use. Solution: Use the `.setAge(18)` query in the server SDK to get specific user documents.
Guille
3 Nov, 2023, 11:55

Hi, I'm not sure how will be your workflow, but check this blog post and tell us if is what you want https://dev.to/appwrite/30daysofappwrite-jwt-l08

Ajit Singh
3 Nov, 2023, 12:06

But server SDK use api keys instead of jwt

Ajit Singh
3 Nov, 2023, 12:06

If I'm right

Guille
3 Nov, 2023, 12:26

You can use .setJWT in the server SDK

Ajit Singh
4 Nov, 2023, 02:42

i am creating a superuser who chan see what documents other people have created like a user based filter on documents. He can add or remove permissions on certain users and I need to check another DB attribute that i why I am using server sdk. Is there any way I can get documents generated by specific users for this filter.

Drake
4 Nov, 2023, 06:41

You would need to store the user in an attribute so that you can query against that attribute

Ajit Singh
4 Nov, 2023, 06:45

okay

Ajit Singh
4 Nov, 2023, 06:45

thanks

Ajit Singh
4 Nov, 2023, 06:46

[Solved] Query to get specific user documents using server sdk

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more