Back

how to get a document id

  • 0
  • Users
  • Functions
dammy
22 Nov, 2023, 10:22

currently want to update a document from server, how do I get it's ID?

TL;DR
The user wants to know how to get a document ID in their application. The document ID is usually found in the URL and is used to interact with specific documents on a website. The user is using NextJS with a Dart SDK for their application. The solution is to either use the Client SDK or the Rest API provided by Appwrite to list all documents and find the desired ID. The user can also find the ID in the console if needed.
fafa
22 Nov, 2023, 10:32

Hey, you can find an ID in the console, or list all the documents using SDK/API.

dammy
22 Nov, 2023, 10:34

how do I fetch that from code itself?

I already know it's possible from console

fafa
22 Nov, 2023, 10:34

Are you using the SDK or Rest API?

dammy
22 Nov, 2023, 10:55

Dart SDK

dammy
22 Nov, 2023, 10:57

Okay

dammy
22 Nov, 2023, 10:59

Thanks Man

dammy
22 Nov, 2023, 11:00

What stack do you do?

fafa
22 Nov, 2023, 11:01

NextJS. I recommend asking other questions in either a new thread for support, or <#564160731327758347> for normal conversations. If you are finished with this thread, please put [SOLVED] in the beginning of the title. 😄

dammy
22 Nov, 2023, 11:04

am trying it out, hope it works

Meldiron
22 Nov, 2023, 11:57

Usually apps do paths like this: https://www.instagram.com/p/CUfA42etUmg/.

That weird text in the URL is some kind of ID. It's common practice to put IDs into URLs, so you can then get them later. It allows you to show correct document on the website, but then also use the ID if someone wants to like it, comment on it, update it or delete it.

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