Vanshaj Kataria
Need Help! I am writing the code below
TypeScript
Client client = FFAppState().appwriteClient;
Databases dbInstance = Databases(client);
DocumentList homesList = await dbInstance.listDocuments(
databaseId: FFAppConstants.dbInstance,
collectionId: FFAppConstants.homesCollection,
);
print('homesList => ${homesList.documents}');
return homesList.documents;
I am just getting the Instance not data, when I print it.
TL;DR
Developers are having trouble getting document list data using `listDocuments` method. The code just returns the instance not the data when printed.
Solution:
Make sure to use the `data` property of the `DocumentList` object to access the actual documents. Update the code like this:
```
Client client = FFAppState().appwriteClient;
Databases dbInstance = Databases(client);
DocumentList homesList = await dbInstance.listDocuments(
databaseId: FFAppConstants.dbInstance,
collectionId: FFAppConstants.homesCollection,
);
print('homesList => ${homesList.data}'); // Use data Vanshaj Kataria
@darShan need help
Recommended threads
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...
- [SOLVED] OAuth With Google & Flutter
Hi all, I'm trying to sign in with google and it all goes swimmingly until the call back. I get a new user created on the appwrite dashboard however the flutte...
- What Query's are valid for GetDocument?
Documentation shows that Queries are valid here, but doesn't explain which queries are valid. At first I presumed this to be a bug, but before creating a githu...