Skip to content
Back

How to Fetch Item and Include the User/Author with JS

  • 0
  • Databases
  • React Native
psygo
6 May, 2025, 07:16

A typical workflow with ORMs is to, for example, fetch an item from the DB and include the user who created it. How would I do that with AppWrite? Is that easily available in the docs somewhere?

Here's an example:

TypeScript
const response = await databases.getDocument(
  DATABASE_ID,
  BOOKS_COLLECTION_ID,
  id,
  // Maybe I should add some sort of query here?
)
TL;DR
How to fetch an item and include the user/author using AppWrite. Developers are asking for guidance on how to achieve this workflow similar to ORMs. The solution involves a specific query in the `getDocument` method.
psygo
6 May, 2025, 07:20

Also, do I need to create a table on the DB to fetch info on other users?

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