Back

How to query a document based on it id, in Javascript ?

  • 0
  • Databases
  • Web
  • Cloud
loloof64
4 Apr, 2024, 08:45

Hi, I would like to query a document based on its id, in javascript. But I'm still failing.

I've tried with equals to "id" and "$id" so far.

And I'm getting an error "AppwriteException: Invalid query: Attribute not found in schema: id"

TL;DR
Developers wanted to query a document based on its ID in JavaScript. They tried using "id" and "$id" but kept getting an error. The solution was to use "$id" for the query, but the page needed to be reloaded for it to work correctly.
loloof64
4 Apr, 2024, 08:53

Sorry, it seems that querying "$id" works, I just forgot to reload my page, and so I still was getting error.

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