Back

Query.select on Document id

  • 0
  • Databases
  • Web
whataboutno13
22 Aug, 2023, 10:28

Hi there! Is it possible to select just the $id of the document in a query? When I tried this Query.select(['\$id']) I've got an internal server error. The index for the $id exists and works with other requests perfectly fine.

TL;DR
The user wants to select only the document IDs in a query instead of the whole document. Currently, it is not possible, but it may be available in a newer version. The user encountered an internal server error when attempting to select just the $id in a query. No solution is provided in the thread.
joeyouss
22 Aug, 2023, 15:24

Hi, it is not possible currently, will be possible in newer version

ideclon
22 Aug, 2023, 15:25

Can you not just use getDocument()?

whataboutno13
23 Aug, 2023, 07:44

Alright, thanks πŸ‘

whataboutno13
23 Aug, 2023, 07:45

No, that would only return a single document. I want a list of Document ids based on other queries

Binyamin
23 Aug, 2023, 15:02

How? Can you elaborate on your use-case?

whataboutno13
23 Aug, 2023, 15:19

Well since relations are still in beta I am writing my own join tables etc. Therefore it would be nice to get only ids instead of the whole document. But of course it could be done in other ways

Binyamin
23 Aug, 2023, 15:20

Gotcha, so you want to select the $id based on the query

whataboutno13
24 Aug, 2023, 09:46

Yes correct

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