I don’t know if I’m just way too tired for today but I can’t seem to find the documentation for the collections I just made.
Okay so I just finished installing Appwrite on a VM with a custom domain, I created a new organization, database, collection, and then added a few documents in that collection for me to try and fetch using Postman.
I was trying to find that link to get those curl requests that you need to make to fetch documents but I can’t find it. Is it not available on the self-hosted solution?
To fetch - or to access any of Appwrite data - on your self-hosted server is the same as the cloud. and for that you can use either
- REST https://appwrite.io/docs/rest
- GraphQL https://appwrite.io/docs/graphql
- Appwrite Web SDK https://appwrite.io/docs/getting-started-for-web
I recommend you'll go with the SDK as it makes the code much more easy to understand, for this the steps would be
- Add web platform in your project
overview
page - Install Appwrite Web SDK
- Init it like so
import { Client, Database } from 'appwrite';
const client = new Client()
.setEndpoint('https://[SERVER_ENDPOINT]/v1')
.setProject('[PROJECT_ID]');
- Init the Database module
const databases = new Databases(client);
- Then fetch all your collection documents like so
const docs = await databases.listDocuments('[DATABASE_ID]', '[COLLECTION_ID]');
Replace
[SERVER_ENDPOINT]
with your server IP or Domain.[PROJECT_ID]
with your project ID[DATABASE_ID]
with your database ID[COLLECTION_ID]
with your collection ID
Thanks. I guess I was just really tired, I was actually thinking of Supabase where after you create your tables and add rows, it gives you code snippets on how to query the data using the structure you defined. But still, I wish the documentation was available from within the hosted solution too, there wasn't a single link for the docs in there and I had to go to the official Appwrite website to look it up. Not a huge deal but it would be nice if the docs were integrated. Especially since there's a chance that the version on the cloud is different from the version that I self-host. The correct docs version would be important in that case.
Anyway, thanks for the guide!
Sure thing<:appwriteupvote:899677724615016528>
Just to amplify all the documentation on the website are for both self-hosted and the cloud.
There is no differences
Just in the version
Eventually the calls will get deprecated as the product grows.. that's just how software evolves.
What you mean?
Well if my self-hosted instance is outdated, it'll probably have deprecated functions that won't be documented in the website - or at least it could still be there and marked as deprecated. Anyway, like I said not a huge deal. I'll just try and keep my instance up-to-date all the time.
Okay.
Just final thing The self-hosted is to verison after the cloud which mean the self-hosted is more featured then the cloud.
Tge upgrade process is not that hard, check this link to see what you would need to do when a new upgrade released.
Recommended threads
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- Custom Domains
Hi All, Should be a quick config issue. I'm setting up custom domains on the hosted version. I have verified the domain with the CNAME but appwrite isn't gene...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...